View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
netzig netzig is offline
external usenet poster
 
Posts: 7
Default Run macro in different workbooks

I am trying to run a macro that originates in an Excel template file. So before the macro is run the file is saved with a certain name. The name of the workbook is then retrieved and built into a string to create the name of the macro and then the command calls the macro. When I run this right in the Excel template file, it will run, however when I run it in a workbook that was created based on the template, the method fails

Code

Dim ThisFile As Workboo
Set ThisFile = ActiveWorkboo
WkbkName = ThisFile.Nam
MacroString = WkbkName & "!make_final_but
ActiveWorkbook.Application.Run MacroString