Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling external VBA sub with parameters

Status
Not open for further replies.

JamieArvato

Technical User
Aug 5, 2004
50
GB
hi

how do i call a sub-procedure with parameters that exists in another file, i.e.:

in Book1.xls, i have:

sub MyProc (my_string as String)
....
end sub

how do i call this from book2.xls?

TIA

jamie
 
Hi Jamie,

This should do it ..

Code:
[blue]Application.Run "Book1.xls!MyProc", "My String"[/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top