LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
KR KR is offline
external usenet poster
 
Posts: 121
Default Indirect reference to run macro in another workbook?

I've tested using the following syntax, and it does run my code just find
Application.Run "MyReallyLongComplicatedFileName.xla!TestMacro "

However, I want to make my code more flexible, and instead of hardcoding the
filename throughout my code every place I need to run some code from that
XLA, I tried setting it up as an indirect reference, e.g.,
Dim Codefile as AddIn
set CodeFile = "MyReallyLongComplicatedFileName.xla"

then in various parts of my code, call the macros using something more like:
Application.Run CodeFile!TestMacro or
Application.Run CodeFile & "!TestMacro"

but so far, I haven't figured out the syntax to make this type of indirect
code reference work.

Can anyone give me a hint?
Thanks!
Keith



 
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
SUMIF and INDIRECT reference to tab in other workbook DJL Excel Discussion (Misc queries) 3 January 29th 10 01:37 PM
Reference macro in another workbook samuel Excel Discussion (Misc queries) 1 October 9th 08 06:26 PM
INDIRECT reference to another worksheet in same workbook Johan Excel Worksheet Functions 4 July 24th 08 02:05 PM
How do I use an indirect reference to a sheet in another workbook? ClintG Excel Discussion (Misc queries) 3 October 27th 06 07:23 PM
Indirect reference Victor[_3_] Excel Programming 3 June 9th 04 05:08 PM


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

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

About Us

"It's about Microsoft Excel"