Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|