Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Running macros from another workbook

I have a workbook called macros.xlm that is a hidden workbook that
I always open when Excel is opened.

If I have another workbook open (say Test.xls) and I create a macro
sub test()

End sub


How do I call a macro from macros.xlm from Test.xls?



I have tried:

sub test()
Run Macros.xlm!A0FormatMeans
End sub

and a few other things but just cannot figure it out.

Lance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Running macros from another workbook

Lance,

The argument to Run should be text.

Run "Macros.xlm!A0FormatMeans"

Having said that, the .xlm extension has me worried. Are you running Excel 4 macros?

--

John Green - Excel MVP
Sydney
Australia


wrote in message ...
I have a workbook called macros.xlm that is a hidden workbook that
I always open when Excel is opened.

If I have another workbook open (say Test.xls) and I create a macro
sub test()

End sub


How do I call a macro from macros.xlm from Test.xls?



I have tried:

sub test()
Run Macros.xlm!A0FormatMeans
End sub

and a few other things but just cannot figure it out.

Lance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Running macros from another workbook

Try

Application.Run "macros.xlm!macroname"

You can also use the recorder to get the above.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

wrote in message
...
I have a workbook called macros.xlm that is a hidden workbook that
I always open when Excel is opened.

If I have another workbook open (say Test.xls) and I create a macro
sub test()

End sub


How do I call a macro from macros.xlm from Test.xls?



I have tried:

sub test()
Run Macros.xlm!A0FormatMeans
End sub

and a few other things but just cannot figure it out.

Lance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Running macros from another workbook

No, I am running Office XP. Should I rename Macros.xlm to Macros.xls?
Everything seems to have run fine up to this point.

My quick fix to this problem is to simply copy the macros I need from
Macros.xlm into the workbook I am currently using.

Lance

John Green wrote:

Lance,

The argument to Run should be text.

Run "Macros.xlm!A0FormatMeans"

Having said that, the .xlm extension has me worried. Are you running Excel 4 macros?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Running macros from another workbook

There's nothing wrong with using .xlm and it would even work with Excel 4 macros.

I was just intrigued that you were using an old extension.

--

John Green - Excel MVP
Sydney
Australia


wrote in message ...
No, I am running Office XP. Should I rename Macros.xlm to Macros.xls?
Everything seems to have run fine up to this point.

My quick fix to this problem is to simply copy the macros I need from
Macros.xlm into the workbook I am currently using.

Lance

John Green wrote:

Lance,

The argument to Run should be text.

Run "Macros.xlm!A0FormatMeans"

Having said that, the .xlm extension has me worried. Are you running Excel 4 macros?




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
Running Macros in a protected workbook Christian Excel Discussion (Misc queries) 1 July 19th 09 01:37 PM
Running 4 macros at once Secret Squirrel Excel Discussion (Misc queries) 2 January 31st 09 09:40 PM
Running VB macros gwtechie72 New Users to Excel 2 November 12th 07 10:04 PM
running macros from IF CJ Excel Worksheet Functions 2 April 30th 06 05:03 PM
Running Macros in protected workbook petunia Excel Worksheet Functions 3 January 18th 05 09:24 PM


All times are GMT +1. The time now is 10:24 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"