Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add a new sheet in a worksheet in VPF9 ?
Message
From
02/01/2016 04:24:00
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
02/01/2016 00:00:25
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP3
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01629519
Message ID:
01629521
Views:
50
>Hi,
>
>I open a workseet in VFP 9, there are 1 sheet only,
>and I want to add a new sheet after the existing worksheet.
>
>I found the Excel Macro command is
> Sheets.Add After:=Sheets(Sheets.Count)
>
>how to convert it VFP 9 coding ?

It's a named parameter, you need to see in VBA help the exact order of parameters (perhaps it's the only one) and any parameters before it, or at least supply the proper number of commas. Assume that After is the third parameter, then this would be

oExcel.workbook.sheets.add(,,oExcel.workbook.sheets.count)

I don't have Excel on my machines so can't tell you which one exactly. You may find out by either by digging through VBA help in Excel, or by suspending your code before that command and then trying out in command window - Intellisense will read Excel's DOM and will show you the list of parameters when you open the parenthesis.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform