Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Can I Move Excel Worksheets from within VFP?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How Can I Move Excel Worksheets from within VFP?
Divers
Thread ID:
00143072
Message ID:
00143072
Vues:
85
Greetings!

I have an application that automates the construction of Excel spreadsheets based on raw imported data. It works rather nicely with column and row totals, as well as shaded rows between subtotals and page formatting.

The problem I am having concerns the use of multiple sheets. My application will add a new sheet for each category of data being processed. However, Excel inserts the sheets at the beginning, instead of adding them to the end. This gets the sorting out of order.

The macro for moving a sheet in Excel is:

Sheets(x).Move After:=Sheets(y)

where "X" is the sheet to move and "Y" is the sheet after which to place it.

I am having trouble making this work in VFP. The equivalent syntax in VFP would be the following:

oExcel.sheets(oVar.nSheetNumber).Move After:=Sheets(oVar.nSheetNumber-1)

VFP chokes on the syntax here. It doesn't know what to do after the ".Move" portion. Does anyone know how to properly move an Excel sheet from within VFP?

Thanks!

Michael Reynolds
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform