Try the following code. I just wrote it but didn't test it:
Dim excelApp As New Excel.Application
excelApp.Workbooks.Open("c:\book1.xls")
excelApp.Workbooks.Open("c:\book2.xls")
excelApp.Workbooks(1).Sheets.Add(excelApp.Workbook s(2).Sheets.Item("Sheet1"))
excelApp.Workbooks(1).Save()
excelApp.Workbooks.Close()
You need to include a reference to the excel library.
Cheers,
Ahmed
Ishan Bhalla wrote:
Hello,
Am not sure if i have put this in the wrong discussion group.
I have 2 workbooks with 1 worksheet each. I want to merge the workbooks into
one. Any idea how to do it? I am using VB.net 2003
Thanks in advance
regards
Ishan