I'm trying to run a macro using Application.Run from a workbook that is selected.
I'm getting an error telling me that the macro is NOT Available.
I'm using Attach = Application.GetOpenFilename to select a workbook so that I can run a macro on it.
After I have selected the workbook, I've asssigned ol as the variable for it.
I had tried using macroName but that didn't work either, so I hardCoded the Macro Name for simpicity.
Need some help with my obviously wrong syntax.
Dim macroString As String
Dim ol As Workbook
Dim macroName As String
macroName = "MakeFinalVendors" ' The name of the Sub procedure in the target workbook
Set ol = ActiveWorkbook
ol.Activate
' Checking to make sure that I'm on the correct workbook
MsgBox ActiveWorkbook.Name
macroString = "'" & activeWorkbookName & "'!MakeFinalVendors'"
' Execute the macro
Application.Run macroString [ THIS IS GIVING ME THE ERROR ]