Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing Excel Sheet
Message
From
23/09/2002 05:25:48
Ashish Patel
Hindustan Petroleum
Mumbai, India
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Accessing Excel Sheet
Miscellaneous
Thread ID:
00703274
Message ID:
00703274
Views:
72
I am using the following code to access Excel File from Visual Foxpro prog which I received from UT only. Thanks for that. Since my excel file is having multiple worksheets how can I point to a particular work sheet?
--------------------------------------------------------------------------
lcXLSFile = 'c:\path\YourXls.xls'
lcRange = "b2:b500"
oExcel = createobject("excel.application")
With oExcel
.Workbooks.open(lcXLSFile)
With .ActiveWorkbook.ActiveSheet.range(lcRange)
For ix = 1 to .Rows.count
For jx = 1 to .Columns.count
? .Cells(ix,jx).Value
Endfor
Endfor
Endwith
.quit
Endwith
-----------------------------------------------------------------------------

Thanks in Advance.

Regards

Ashish Patel
Next
Reply
Map
View

Click here to load this message in the networking platform