Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How many sheets in an Excel Workbook
Message
De
01/07/1999 14:39:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00236598
Message ID:
00236617
Vues:
10
Try .Sheets.Count

In Excel, use the VBA Object Browser and drill down to sheets. You should get the details there.
I know Excel defaults to 3 sheets when it opens a new workbook, but you are opening a old file.
If you are addressing a sheet by using the name Excel has assigned, be careful.
I have seen Excel change the 'Sheet 1' to 'Sheet 2' when I created a chart. All my data references for the chart were pointing to Sheet 1. I assigned Sheet 1 a name and referred the sheet name and everything worked fine.

>I use the following code to open an Excel Workbook from VFP:
>
>ExcelObj = CreateObject('Excel.Application')
>ExcelObj.Visible = .T.
>ExcelObj.Workbooks.Open("D:\TEST.XLS")
>
>Does anyone know of a way to return the number of WORKSHEETS in the open workbook? I can't seem to find an object property that tells me this.
>
>Thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform