Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excell books merg
Message
From
08/11/2005 01:55:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01065904
Message ID:
01066310
Views:
16
hi,
thank you for reply,
i try as under ,i get a message (there is alarge amount of information on clipboard. do you want to be able to paste this information into another program later....> i try YES and NO
I don't see any new excel sheet at my folder,
any help ,idea.
thanks

Remark.
---------
every book have one sheet only, the bigest one have 2651 records ,size is 718 KB.
oExcel = CREATEOBJECT("Excel.Application")
DIMENSION MyExcelFiles[5]

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

oExcel.WorkBooks.Open(MyExcelFiles[1])
oActive = oExcel.ActiveWorkbook.Name
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.Quit()
oExcel = NULL
RELEASE oExcel
>See Re: Combining XLS files into one workbook Message #1036029
>
>>i need to merg 5 excel books mybe more , at one excell book ,
>>
>>ex.. i have 5 excell books (names) as under, at my folder e:\ddata1,
>>
>>any idea how i can put all, at one book with name as ALLCustomerlist.excel
>>
>>CustomerList-1214-Report20051106052251 && or any small name
>>CustomerList-1214-Report20051030061028
>>CustomerList-1214-Report20051023055035
>>CustomerList-1214-Report20051016053609
>>CustomerList-1214-Report20051009053220
>>CustomerList-1214-Report20051002064258
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform