#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default add-ins

i needed to create a way to be able to use a macro and a reference for
mulitple workbooks and files, so i pulled up a blank spreadsheet
imported my macro, added my references, than saved it as an *.xla file
and now i have it as an add in, but now that it's an add in, how do i
reference the macro ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default add-ins

Application.Run "MyAddin.xla!MyMacroName"

or if it returns a value

res = Application.Run("MyAddin.xla!MyMacroName")

--
Regards,
Tom Ogilvy

"tommy" wrote in message
...
i needed to create a way to be able to use a macro and a reference for
mulitple workbooks and files, so i pulled up a blank spreadsheet
imported my macro, added my references, than saved it as an *.xla file
and now i have it as an add in, but now that it's an add in, how do i
reference the macro ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default add-ins

Tom Ogilvy wrote:

Application.Run "MyAddin.xla!MyMacroName"

or if it returns a value

res = Application.Run("MyAddin.xla!MyMacroName")


your the man the tom!!!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default add-ins

Tom,
I doing the same thing you suggested to tommy, I found that the
Application.Run fucntion only worked for me when the addin had no spaces in
its name. Is there a reason for this?

Regards,
Alex J


"Tom Ogilvy" wrote in message
...
Application.Run "MyAddin.xla!MyMacroName"

or if it returns a value

res = Application.Run("MyAddin.xla!MyMacroName")

--
Regards,
Tom Ogilvy

"tommy" wrote in message
...
i needed to create a way to be able to use a macro and a reference for
mulitple workbooks and files, so i pulled up a blank spreadsheet
imported my macro, added my references, than saved it as an *.xla file
and now i have it as an add in, but now that it's an add in, how do i
reference the macro ?





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default add-ins

Alex,

If there are spaces in the file name, you need to enclose the
file name within single quotes. E.g.,

res = Application.Run ("'My Add In.xla'!MyMacroName")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Alex J" wrote in message
. ..
Tom,
I doing the same thing you suggested to tommy, I found that the
Application.Run fucntion only worked for me when the addin had

no spaces in
its name. Is there a reason for this?

Regards,
Alex J


"Tom Ogilvy" wrote in message
...
Application.Run "MyAddin.xla!MyMacroName"

or if it returns a value

res = Application.Run("MyAddin.xla!MyMacroName")

--
Regards,
Tom Ogilvy

"tommy" wrote in message
...
i needed to create a way to be able to use a macro and a

reference for
mulitple workbooks and files, so i pulled up a blank

spreadsheet
imported my macro, added my references, than saved it as an

*.xla file
and now i have it as an add in, but now that it's an add

in, how do i
reference the macro ?







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



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