Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Can I Move Excel Worksheets from within VFP?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How Can I Move Excel Worksheets from within VFP?
Miscellaneous
Thread ID:
00143072
Message ID:
00143072
Views:
84
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
Map
View

Click here to load this message in the networking platform