Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
How Can I Move Excel Worksheets from within VFP?
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement