Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel file is selected
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Excel file is selected
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01136176
Message ID:
01136176
Views:
51
Hi everybody,

I have a procedure that creates Excel from DBF and applies some custom formatting. Everything is fine except when I open the Excel, it comes selected.

I assume this code is responsible for this:
		with loSheet.range(m.lcRange).Interior
			.ColorIndex = 33 && Blue Color
			.pattern = xlSolid
			.PatternColorIndex = xlAutomatic
		endwith
	endif
	
** Made the Totals row in bold and Green highlight
	loExcel.range([A1], loExcel.selection.SpecialCells(xlLastCell)).select
	loExcel.selection.FormatConditions.delete
	loExcel.selection.FormatConditions.add(xlExpression,, '=UPPER(Left($A1,5))="TOTAL"')

	with loExcel.selection.FormatConditions(1)
		.font.Bold = .t.
		.Interior.ColorIndex = 4
	endwith
My question is, how should I unselect everything before saving, e.g. nothing should be selected?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform