Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel file is selected
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01136176
Message ID:
01136182
Views:
11
This message has been marked as the solution to the initial question of the thread.
I doubt that you may open Excel file with nothing selected. The cursor should be somewhere located, and that cell is selected by default.

See if :

... Range("A1").Select
... save()

will help.


>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform