Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refrence a workbook procedure from another workbook
Hi everyone!
I have many workbooks that basicaly do the same thing with different data. Now I copy all the code ( 15 procedures) into the new workbook each time I need to creat a new workbookith new data . My question is :Is it possible to have one workbook somewhere in the server with all macros and codes and and use it as a refrence to other workbooks (use tools\refrence\...) and just use the macros without actually copying them to the new workbooks . If yes how? I tried to do but I get an error(name conflict with existing project,object library). Thanks :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refrence a workbook procedure from another workbook
Yes, I have several files that are accessed through the network for
formatting reports and such. I set up a toolbar to load when the workbook opens that asks the user to install the toolbar. If yes is chosen, the toolbar installs. The toolbar automatically sets the correct link to the workbook. I use this method so if I make any changes to the file the user does not have to reinstall the toolbar. Regards, Alan "Harvey" wrote in message ... Hi everyone! I have many workbooks that basicaly do the same thing with different data. Now I copy all the code ( 15 procedures) into the new workbook each time I need to creat a new workbookith new data . My question is :Is it possible to have one workbook somewhere in the server with all macros and codes and and use it as a refrence to other workbooks (use tools\refrence\...) and just use the macros without actually copying them to the new workbooks . If yes how? I tried to do but I get an error(name conflict with existing project,object library). Thanks :) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refrence a workbook procedure from another workbook
Hi Alan,
I guess I need to explain more about the task Im trying to accomplish. Let say I have the "workbook1.xls" with some macros in it ( exp. sorting a database in sheet 1) somewhere in our server, now I have to create a new "workbook2" for a different client but instead of rewriting the sort macro again in a module I want to use the macro which I have in "workbook1" by refrencing to it in my code. Is it possible? Thanks "Alan" wrote: Yes, I have several files that are accessed through the network for formatting reports and such. I set up a toolbar to load when the workbook opens that asks the user to install the toolbar. If yes is chosen, the toolbar installs. The toolbar automatically sets the correct link to the workbook. I use this method so if I make any changes to the file the user does not have to reinstall the toolbar. Regards, Alan "Harvey" wrote in message ... Hi everyone! I have many workbooks that basicaly do the same thing with different data. Now I copy all the code ( 15 procedures) into the new workbook each time I need to creat a new workbookith new data . My question is :Is it possible to have one workbook somewhere in the server with all macros and codes and and use it as a refrence to other workbooks (use tools\refrence\...) and just use the macros without actually copying them to the new workbooks . If yes how? I tried to do but I get an error(name conflict with existing project,object library). Thanks :) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refrence a workbook procedure from another workbook
Use a Workbook_Open in the ThisWorkbook module of the workbook.
In that Open event, place code to install a toolbar when the workbook opens, referencing the sort macro name in the construction of the toolbar Under the Open event macro, place the sort macro code. Since the toolbar is constructed from code within your sort module workbook, it automatically references the correct location of the macros when it installs. When running a macro from the toolbar the module workbook will open and will become the activewindow. You'll need to insert the activewindow.activatenext statement in your code to regain focus before your code starts. I use this method when multiple users want access. This makes sure we are all working on the same page, as they say, and I don't have to install any modules on user computers. This facilitates changes that might be made to the code. The changes are made in one place and are not noticed by the user. That method, after a change, requires going to every computer running the macros. Macros used for my personal job duties remain in modules on my local drive. I use the toolbar as a multipurpose tool, allowing access to macros and templates. In building the toolbar include macros which go out and bring templates to the desktop. I use them for just about everything. I can build it from one location and control it from one location. Man, I just went on and on didn't I. Regards, Alan "Harvey" wrote in message ... Hi Alan, I guess I need to explain more about the task Im trying to accomplish. Let say I have the "workbook1.xls" with some macros in it ( exp. sorting a database in sheet 1) somewhere in our server, now I have to create a new "workbook2" for a different client but instead of rewriting the sort macro again in a module I want to use the macro which I have in "workbook1" by refrencing to it in my code. Is it possible? Thanks "Alan" wrote: Yes, I have several files that are accessed through the network for formatting reports and such. I set up a toolbar to load when the workbook opens that asks the user to install the toolbar. If yes is chosen, the toolbar installs. The toolbar automatically sets the correct link to the workbook. I use this method so if I make any changes to the file the user does not have to reinstall the toolbar. Regards, Alan "Harvey" wrote in message ... Hi everyone! I have many workbooks that basicaly do the same thing with different data. Now I copy all the code ( 15 procedures) into the new workbook each time I need to creat a new workbookith new data . My question is :Is it possible to have one workbook somewhere in the server with all macros and codes and and use it as a refrence to other workbooks (use tools\refrence\...) and just use the macros without actually copying them to the new workbooks . If yes how? I tried to do but I get an error(name conflict with existing project,object library). Thanks :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
link to workbook by cell refrence | Excel Discussion (Misc queries) | |||
Help with workbook procedure | Excel Worksheet Functions | |||
How to jump from a Form procedure to a Workbook or Module procedure? | Excel Programming | |||
Wildcards in other workbook cell refrence? | Excel Worksheet Functions |