Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EXCEL sheets.
Message
From
14/01/2002 13:21:32
Jonathan Cochran
Alion Science and Technology
Maryland, United States
 
 
To
14/01/2002 13:01:45
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00604451
Message ID:
00604460
Views:
29
lo_Excel = CREATEOBJECT("Excel.Application")
lo_Excel.Workbooks.ADD()
FOR EACH lo_Sheet IN lo_Excel.Sheets
   ? lo_Sheet.NAME
ENDFOR
lo_Excel.ActiveWorkbook.CLOSE()
lo_Excel.QUIT()
>I am doing some automation with excel and I am not sure how to find out how many sheets are in an excel workbook.
>
>ex:
>loExcel = createobject("excel.application')
>WITH loExcel
> .workbooks.sheets.count
>ENDWITH
>
>is the above correct. also how can I find out the name of each sheet.
>
>The problem is, I have to pick up these work sheets from the server each week and there are three sheets in the workbook and the name of the sheets may change, so I would like to dynamically figure out the name of the sheets and rename them. I know how to rename them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform