Folks, I have a sub which amongst other things opens a workbook, and (hopefully) will run a macro in that workbook.
I know that generally, the code:
Application.Run "Workbook Name!Sub Name" achieves this.
My problem is that the Workbook Name may vary.
When I run that line of code, the relevant name of the workbook will be stored in a variable named "SesameLogName", and I wish to run a sub in that workbook (which is already open) called "Sesame".
Is there a way of generalising the above line of code in a format where the Workbook Name and Sub Names are in variables?
Application.Run Variable1!Variable2 doesn't work.
Any ideas?
Cheers
Gopes
I know that generally, the code:
Application.Run "Workbook Name!Sub Name" achieves this.
My problem is that the Workbook Name may vary.
When I run that line of code, the relevant name of the workbook will be stored in a variable named "SesameLogName", and I wish to run a sub in that workbook (which is already open) called "Sesame".
Is there a way of generalising the above line of code in a format where the Workbook Name and Sub Names are in variables?
Application.Run Variable1!Variable2 doesn't work.
Any ideas?
Cheers
Gopes