• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Executing Macro vs. another open workbook

polarisking

Member
My macro is in its own dedicated workbook (.xlsm) (the name of the target workbook changes from period to period and the workbook name is effectively unknown.)

I can always do a GetOpenFileName, but I'd like to do something other than that.
  1. I know the target workbook will be open
  2. I'd like to avoid the Alt-F8 or Run Macro from the target workbook
  3. I'd like to give the users a single button to press to run the macro. It cannot reside in the target workbook for the reason specified earlier.
So, how do I give the use a button in the macro workboot and point them to another open workbook (the target?) I'd like to avoid a userform, if possible, but it it's the only way, then so be it.

Thank you in advance.
 
Hi ,

You can do 2 things :

1. Add your macro to the QAT , and make it available to all workbooks

2. Ensure that all of the code in your macro refers to the ActiveWorkbook as the qualifier for all objects

Users can now click on the macro button on the QAT from the target workbook i.e. users will open the target workbook , and while that workbook is the active workbook , click on the macro button.

Narayan
 
Back
Top