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