Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Renaming an excel sheet
Message
From
19/04/2005 04:52:50
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01006084
Message ID:
01006088
Views:
30
Try This;

oLeApp=CREATEOBJECT("Excel.Application")
oleapp.visible = .T.
OWrkbk = oLeApp.workbooks.add
owrkbk.sheets(1).Name = "New"

So if you want to rename more than one you can loop around the owrkbk.Sheets.Count value.

HTH

Jon

>hi all,
>i am trying to rename an excel sheet, several actually as it will be in a loop, to the parameter mcusname but i have tried a lot of different ways without joy. i have included a few examples so you can see what track i was going down, anyone any idea whats going wrong?
>
>OleApp.Sheets("Sheet1").Name = "mcusname"
>OleApp.Sheets("Sheet1").Name = &mcusname
>OleApp.Sheets("Sheet1").Name = ("mcusname")
>OleApp.Sheets("Sheet1").Name(mcusname)
>
>Slán
>~M
Previous
Reply
Map
View

Click here to load this message in the networking platform