Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help - How Read Excel cells to VFP
Message
 
To
19/06/2001 22:42:00
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00521266
Message ID:
00521364
Views:
13
Peter,

There are SpecialCells and UsedRange objects that you can use:
lcLastCell = ObjExcel.ActiveSheet.Range("A1").SpecialCells(11).Address(.f.,.f.,-4150)
ObjExcel.ActiveSheet.UsedRange.Rows.Count
ObjExcel.ActiveSheet.UsedRange.Columns.Count
ObjExcel.ActiveSheet.Cells.Select && all used cells

Regards
>>>>>>>>>>>>>>>>>>>>>>> YOUR MESSAGE BELOW>>>>>>>>>>>>>>>>>>>>>>

I'm working with Excel spreadsheet and must READ a Range of values from
cells to import those values to VFP.

I know that the Column range always goes from cell D15 to L15,(this case)
But the number of columns can vary from 1 row to more than 4000 rows.

Question: How can I define the Range in this case, so I could pass
the contents off all cells to VFP/Or how can I know the number os rows
for a range, then its always relative the number of rows it will have.

Does this kind of code also work with non continuos range ?
oRange = oExcel.ActiveSheet.Range("x:y")
FOR nRow = 1 TO oRange.Rows.Count
FOR nColumn = 1 TO oRange.Columns.Count
? oRange.Cells[nRow, nColumn].Value
ENDFOR
ENDFOR

Please help !!

Thanks in Advance.
Peter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform