Call a Sub from another Worksheet

M

Mike H.

I can't seem to get this to work:
Dim wb As Workbook
Set wb = Workbooks.Open("z:\journal entry.xlsm")
Application.Run wb.Name & "!CreateSubmittal"

The Sub CreateSubmittal is designated as "Public Sub CreateSubmittal()" or
not.
The Sub is in the THisWorkbook object or Module1. Neither works.

Ideas? Thanks!
 
J

JLGWhiz

Hi Mike, It's all in the Quote marks. Note the Apotrophe enclosed in double
quotes on both ends of the file name variable.

Application.Run "'" & wb.Name & "'" & "!CreateSubmittal"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top