Connecting Tech Pros Worldwide Help | Site Map

Macro to link two workbooks

Newbie
 
Join Date: Aug 2008
Posts: 17
#1: Aug 26 '08
I was wondering if there is a way to link two separate workbooks together with the click of a macro button. I want to click a button and the information be sent to another workbook saved in a different place. Is this possible?
Moderator
 
Join Date: Feb 2008
Location: Beauly, near Inverness, Scotland
Posts: 1,576
#2: Aug 26 '08

re: Macro to link two workbooks


Hi. There is not enough detail in your question to give you any more than a general response. Visual Basic for Applications (VBA) is the language Excel uses for macros. VBA is the common applications language for all of the Office suite and for other MS products (Outlook, Visio and so on). VBA has a wide range of facliities to manipulate workbooks and a very rich object model which allows for modifying individual cells, ranges, formulas, charts, and many, many other Excel items. So yes, without a doubt you can link two workbooks together using code automation to do so.

What is certain is that you would need to be very precise about what it is you want to do, as it will require custom programming. It is very unlikely that the macro recorder will be of much assistance to you with porting worksheet data from one workbook to another unless all you are doing is a simple worksheet copy and paste. For a custom programmed approach you will need to be familiar with the Excel object model and the Visual Basic for Applications programming language.

There are a number of posts in this forum which will give you pointers to the techniques involved - use the search facilities to assist you. You may also find this HowTo article on Application Automation interesting as a general intro to the VBA automation model.

-Stewart
Newbie
 
Join Date: Aug 2008
Posts: 17
#3: Sep 2 '08

re: Macro to link two workbooks


Thanks for the information. I figured out how to do what I was wanting!
Reply


Similar Microsoft Access / VBA bytes