General information
Category:
Coding, syntax & commands
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only