Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call a worksheet (as a function) Bernie Excel Discussion (Misc queries) 18 April 20th 09 06:15 PM
How can i call a function on another worksheet Jorge Ribeiro Excel Programming 2 January 21st 09 04:53 PM
how to call the event of other worksheet chad Excel Worksheet Functions 1 May 30th 07 09:48 AM
how do I call specific worksheet vbidiot[_10_] Excel Programming 4 March 4th 06 09:38 PM
call a macro in another worksheet? George Conard Excel Programming 2 May 16th 05 08:38 PM


All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"