Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excell books merg
Message
From
08/11/2005 08:55:58
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01065904
Message ID:
01066399
Views:
21
hi ,
i try as under , i think rong position
i see the same error message
oExcel = CREATEOBJECT("Excel.Application")
DIMENSION MyExcelFiles[5]

MyExcelFiles[1] = "e:\a.XLS"
MyExcelFiles[2] = "e:\b.XLS"
MyExcelFiles[3] = "e:\C.XLS"
MyExcelFiles[4] = "e:\d.XLS"
MyExcelFiles[5] = "e:\e.XLS"

oExcel.WorkBooks.Open(MyExcelFiles[1])
oActive = oExcel.ActiveWorkbook.Name
*oExcel.ActiveWorkbook.SaveAs(lcNewXlsName)&&&

FOR nXLS = 2 TO 5
    ** Because COPY TO XL produce only one sheet we must insert a new one here
    oExcel.ActiveWorkbook.Sheets.Add()
    oExcel.WorkBooks.Open(MyExcelFiles[nXLS])
    cNewBook = oExcel.ActiveWorkbook.Name
    oExcel.ActiveWorkbook.ActiveSheet.Cells.Select()
    oExcel.Selection.Copy()
    oExcel.Windows(oActive).Activate
    oExcel.ActiveWorkbook.ActiveSheet.Paste()
    oExcel.Windows(cNewBook).Activate
    oExcel.ActiveWorkbook.Close()
    oExcel.Windows(oActive).Activate
NEXT
*oExcel.ActiveWorkbook.Save()
oExcel.ActiveWorkbook.SaveAs(lcNewXlsName)&&&&

oExcel.Quit()
oExcel = NULL
RELEASE oExcel
thanks
>
>oExcel.ActiveWorkbook.SaveAs(lcNewXlsName)
>
>>thank youn for reply,
>>sorry, not clear saveas() .
>>pls. can explain more.
>>
>>or where i can use it at the code.
>>
>>thanks
>>
>>>Use SaveAs() method to specify full file name for the Excel file.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform