General information
Category:
Coding, syntax & commands
Title:
Accessing Excel Sheet
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only