PC Review


Reply
Thread Tools Rate Thread

Call a Sub from another Worksheet

 
 
Mike H.
Guest
Posts: n/a
 
      27th Apr 2010
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 With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      27th Apr 2010
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." <(E-Mail Removed)> wrote in message
news:4727B3E3-802E-47EF-A2C8-(E-Mail Removed)...
>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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i call a function on another worksheet Jorge Ribeiro Microsoft Excel Programming 1 21st Jan 2009 04:39 PM
how to call the event of other worksheet =?Utf-8?B?Y2hhZA==?= Microsoft Excel Worksheet Functions 1 30th May 2007 09:48 AM
how do I call specific worksheet vbidiot Microsoft Excel Programming 4 4th Mar 2006 09:38 PM
call a macro in another worksheet? =?Utf-8?B?R2VvcmdlIENvbmFyZA==?= Microsoft Excel Programming 2 16th May 2005 08:38 PM
Call VB6 DLL from Worksheet without VBA wrapper Lawrence Microsoft Excel Programming 2 19th Sep 2003 10:04 AM


Features
 

Advertising
 

Newsgroups
 


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