Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Run code from separate workbook

I have several master files that need to run the same code, so I want to keep
only one set of code in a separate workbook for easier maintenance. The code
works fine, but I have the button in each of the masters to click on to run
the macro. It first opens up the code-only workbook, which then becomes the
active workbook, so all the code is performed on that workbook instead of the
master. I obviously am trying to avoid telling Excel to activate the specific
master file since it will be different in each case. So my question is, how
can I activate the master file without specifying a file name, OR how can I
open the code-only workbook and run the macro without activating that
workbook? Any help would be greatly appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Run code from separate workbook

hi,
put the code in a workbook named personal. put your personal file in the xl
startup folder then hide the personal workbook. each time xl is opened the
personal file will open and be hidden in the background but all macros will
be available.

regards
FSt1


"Mike" wrote:

I have several master files that need to run the same code, so I want to keep
only one set of code in a separate workbook for easier maintenance. The code
works fine, but I have the button in each of the masters to click on to run
the macro. It first opens up the code-only workbook, which then becomes the
active workbook, so all the code is performed on that workbook instead of the
master. I obviously am trying to avoid telling Excel to activate the specific
master file since it will be different in each case. So my question is, how
can I activate the master file without specifying a file name, OR how can I
open the code-only workbook and run the macro without activating that
workbook? Any help would be greatly appreciated!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Run code from separate workbook

But it needs to be able to be opened by other people as well. I think I found
a workaround. Thanks.

"FSt1" wrote:

hi,
put the code in a workbook named personal. put your personal file in the xl
startup folder then hide the personal workbook. each time xl is opened the
personal file will open and be hidden in the background but all macros will
be available.

regards
FSt1


"Mike" wrote:

I have several master files that need to run the same code, so I want to keep
only one set of code in a separate workbook for easier maintenance. The code
works fine, but I have the button in each of the masters to click on to run
the macro. It first opens up the code-only workbook, which then becomes the
active workbook, so all the code is performed on that workbook instead of the
master. I obviously am trying to avoid telling Excel to activate the specific
master file since it will be different in each case. So my question is, how
can I activate the master file without specifying a file name, OR how can I
open the code-only workbook and run the macro without activating that
workbook? Any help would be greatly appreciated!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Run code from separate workbook

I would place the macros into a new workbook and save that as an add-in.

Load it through toolsadd-ins and it is always available for any open workbook.

Or stick the macros into Personal.xls if you have one.


Gord Dibben MS Excel MVP

On Tue, 31 Jul 2007 10:24:01 -0700, Mike wrote:

I have several master files that need to run the same code, so I want to keep
only one set of code in a separate workbook for easier maintenance. The code
works fine, but I have the button in each of the masters to click on to run
the macro. It first opens up the code-only workbook, which then becomes the
active workbook, so all the code is performed on that workbook instead of the
master. I obviously am trying to avoid telling Excel to activate the specific
master file since it will be different in each case. So my question is, how
can I activate the master file without specifying a file name, OR how can I
open the code-only workbook and run the macro without activating that
workbook? Any help would be greatly appreciated!


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
separate columns (three letter code) mariekek5 Excel Discussion (Misc queries) 7 March 16th 10 01:21 PM
Range name in separate workbook Arun Excel Discussion (Misc queries) 0 November 30th 06 08:42 PM
Code for Printing All Filtered Rows Separate Darrell Lankford Excel Programming 3 March 1st 06 08:34 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Issuing macro in workbook from separate workbook Nigel Excel Discussion (Misc queries) 1 May 16th 05 05:46 PM


All times are GMT +1. The time now is 10:50 PM.

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"