Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call a Sub from another Worksheet
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! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call a Sub from another Worksheet
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" "Mike H." wrote in message ... 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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to call a worksheet (as a function) | Excel Discussion (Misc queries) | |||
How can i call a function on another worksheet | Excel Programming | |||
how to call the event of other worksheet | Excel Worksheet Functions | |||
how do I call specific worksheet | Excel Programming | |||
call a macro in another worksheet? | Excel Programming |