Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting cells in excel ole automation
Message
From
11/07/2001 11:37:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Selecting cells in excel ole automation
Miscellaneous
Thread ID:
00529193
Message ID:
00529193
Views:
73
I am accessing an excel speadsheet via ole automation in my VFP program.
I start excel and open the speadsheet.

objExcel = CreateObject("Excel.Application")
xlquote = objExcel.WorkBooks.Open("g:\quotesheet\quotesheet.xls")

I want to select all of the data on sheet1.
I can select cell A1 like this

xlquote.worksheets("sheet1").range("A1").select

I can select a range of cells like this

xlquote.worksheets("sheet1").range("A1","O5").select

However, when I try to use this code which I found on several VBA sites
as the method to select all the cells containing data on the
sheet I get an error in foxpro.
"Variable XLLASTCELL not found"


xlquote.worksheets("sheet1").range("A1",xlquote.worksheets("sheet1").activecell.specialcells(xlLastCell)).select


this code, as a macro in excel does work.
range("A1").select
range("A1",activecell.specialcells(xlLastCell)).select


What do I need to do to make xlLastCell available to VFP?
Or, is there another method to do this?
Next
Reply
Map
View

Click here to load this message in the networking platform