Hi guys!
Can anybody help me how to properly Add a new sheet in excel? My problem is when I simply issue the Add method without the necessary parameters (which I don't know how to invoke in VFP), the new sheet positions itself before the last sheet in the workbook. What I want is to place the new sheet after the last sheet (rightmost). Here's my sample code:
[tt]
oExcel=createobject('Excel.Application')
oExcel.Visible=.T.
xlfile="myfile.xls"
oExcel.Application.Workbooks.Open(xlfile)
.
.
oExcel.Application.Workbooks(1).Sheets.Add
[/tt]
I need to know how to set the After and Before options. I know how to do this in VB but not in VFP.
Can anybody help me how to properly Add a new sheet in excel? My problem is when I simply issue the Add method without the necessary parameters (which I don't know how to invoke in VFP), the new sheet positions itself before the last sheet in the workbook. What I want is to place the new sheet after the last sheet (rightmost). Here's my sample code:
[tt]
oExcel=createobject('Excel.Application')
oExcel.Visible=.T.
xlfile="myfile.xls"
oExcel.Application.Workbooks.Open(xlfile)
.
.
oExcel.Application.Workbooks(1).Sheets.Add
[/tt]
I need to know how to set the After and Before options. I know how to do this in VB but not in VFP.