>Hello,
>
>I'm trying to automate the creation of a workbook by inserting specific sheets from different workbooks. There is a problem in the syntax of my move which I can't seem to pinpoint.
>
>
>My code:
>myExcel.Application.Workbooks(2).Sheets(1).Move ;
> After:=myExcel.Application.Workbooks(1).Sheets(1)
>
>Thanks in advance!
Syntax is :
Worksheet.Move(Before,After) and you can only specify either Before or After parameter. VFP uses positional parameters not named parameters like ( After: = .... )
oExcel = CreateObject('Excel.Application')
WITH oExcel
.Workbooks.Add
.Visible = .t.
With .Activeworkbook
.WorkSheets("Sheet1").Move(.null.,.WorkSheets("Sheet3"))
endwith
ENDWITH
Cetin