Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro available in all workbooks Tigerxxx Excel Discussion (Misc queries) 9 July 23rd 09 03:41 AM
macro to all workbooks [email protected] New Users to Excel 2 February 27th 08 06:16 PM
macro to all workbooks [email protected] New Users to Excel 1 February 24th 08 11:47 AM
macro help in workbooks equine investor Excel Discussion (Misc queries) 0 March 16th 06 03:18 AM
Macro in all workbooks Pam Coleman Excel Discussion (Misc queries) 2 February 24th 05 07:49 PM


All times are GMT +1. The time now is 03:06 PM.

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"