|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Merging workbooksHello,
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 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.Workbooks(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: Show quoteHide quote > 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
Resolution in VB.NET
Difference between Class and module MDI Form Question Big Imagelist Out Of Memory Lost with creating a db connection... help!? Using an object from a Generically defined class as a variable. passing values to html document from .Net app Is it possible to order a Visual Basic 2005 Express CD from Microsoft? Using SOAP with VB.net Mutiple projects under one solution - can't find a class in the first |
|||||||||||||||||||||||