Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
link to workbook by cell refrence Rich[_2_] Excel Discussion (Misc queries) 1 May 15th 08 08:50 AM
Help with workbook procedure CC Excel Worksheet Functions 0 January 7th 08 05:37 PM
How to jump from a Form procedure to a Workbook or Module procedure? T. Erkson Excel Programming 4 January 25th 07 07:15 PM
Wildcards in other workbook cell refrence? Pootler Excel Worksheet Functions 1 June 2nd 05 05:55 PM


All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"