Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing a worksheet form an Excel workbook
Message
From
09/09/1998 11:54:25
 
 
To
09/09/1998 11:26:04
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00134561
Message ID:
00134580
Views:
14
Tom ---

Try the following (it may need some tweaking)
oExcel=CREATEOBJECT("Excel.Application")
oExcel.Workbooks.Open("XLSFileName.XLS")
FOR nCounter = 1 TO oExcel.Worksheets.Count
   DIME cWorkSheets(nCounter)  &&& Dynamic resizing of array is OK
   cWorkSheets(nCounter) = oExcel.Worksheets(nCounter).Name
ENDFOR
>Does anyone know of a method that can determine from VFP the number and/or name of the wooksheets in an excel work book. I woluld like to allow the users to select the actual worksheet prior to import instead of requiring all data be contained on sheet1. Thanks!
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform