473,626 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Merging workbooks

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

Jun 26 '06 #1
1 1766
Try the following code. I just wrote it but didn't test it:

Dim excelApp As New Excel.Applicati on
excelApp.Workbo oks.Open("c:\bo ok1.xls")
excelApp.Workbo oks.Open("c:\bo ok2.xls")

excelApp.Workbo oks(1).Sheets.A dd(excelApp.Wor kbooks(2).Sheet s.Item("Sheet1" ))
excelApp.Workbo oks(1).Save()
excelApp.Workbo oks.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


Jun 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
25318
by: Damian Arntzen | last post by:
I'm a beginner to moderate programmer who's fiddling around with automating Excel, in particular after being able to have the user fill out a form and it then generate the workbook. I can't quite figure out how to get it to Merge cells together - I've found how to do it (I think) but can't nut out the syntax. Any help with this would be much appreciated (I've tried looking for online tutorials, but the ones I've found never touch merging)....
0
248
by: Ishan Bhalla | last post by:
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
2
1835
by: cbs81 | last post by:
hi all, problem: transferring data from workbooks that are stored in a particular directory from excel to a table in access. when done, the workbooks that have been processed are automatically moved into a directory named “processed” . all using vba. this is the pretty complex vb problem that i need some expert solution to. overview. i have created a cash reconciliation application in excel saved by month for each of my bus...
22
68676
by: robertgregson | last post by:
Using C#, .NET3.5, Visual Studio 2008 and WCF on Windows VISTA SP1, I have written a service, service host (as a C# console application) and a client. The service uses Microsoft.Office.Interop.Excel.Application to access an Excel file on the local hard drive, opens it (using Application.Workbooks.Open), reads out some data and the provides said data to the client. Everything works perfectly when the Service Host is a C# console...
1
8366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.