Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disecting an Excel Worksheet
Message
From
07/03/2009 09:32:26
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Disecting an Excel Worksheet
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01386393
Message ID:
01386393
Views:
97
Hi All...

I have an Excel worksheet which can have many columns. The header column has data which correspond to the field names in a DBF table. How can I identify which column #'s are ITEM & PRICE and whether thay contain character or numeric data ?

Listed below is my attempted code. Any help is greately appreciated.

Thank You in advance..

Raz
LOCAL oExcel, lcItem, lnCost
lcFile = "HITACHI.XLS"

oExcel = CREATEOBJECT("Excel.Application",)
oExcel.Workbooks.Open(lcFile)
oExcel.Workbooks(1).Sheets(1).Select()
oExcel.Cells.Select
mnLastRow = oExcel.activesheet.UsedRange.ROWS.COUNT
rr = oExcel.activesheet.UsedRange.ROWS.COUNT
mcLastRow = ALLTRIM(STR(mnLastRow))

lcItem = oExcel.Cells(rr,??).value		&& oExcel.Cells(rr,08).value
lnCost = oExcel.Cells(rr,??).value		&& oExcel.Cells(rr,12).value
Next
Reply
Map
View

Click here to load this message in the networking platform