My objective is to create a macro (PasteTokenData_M) on the Personal Macros Workbook that can run subs (e.g., ReplaceTokens) existing in a module (mPointLinksFieldsXls) on various worksheets. I will also add a QAT icon that will run this macro when a particular worksheet containing the subs is active. I have not been able to make this work. I get an error message on the Application.Run command. (see attached)
A simplified version of my macro code is below. Is there an obvious mistake in my code? Perhaps it is in how I am using the "GetFileName" variable to call the subs on the active worksheet. .
[vba]
Option Explicit
Public Sub PasteTokenData_M()
'
'
'DETERMINE NAME OF ACTIVE DOCUMENT
Dim GetFileName As String
GetFileName = ActiveWorkbook.Name
'RUN CODE ON ACTIVE WORKSHEET TO REPLACE TOKENS
Application.Run "GetFileName!ReplaceTokens"
End Sub
[/vba]