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!

Application.Run Problem

Status
Not open for further replies.

MJPPaba

MIS
May 28, 2003
142
GB
Hi All,

The following line doesn't seen to work

Sub mdl_GetData()
Application.Run ("'my workbook.xls'.'my sheet'!cmdBtn_Click")
end sub

Several things causing issues here:
1 there are spaces in the workbook name
2 there are spaces in the sheet name
3 the code I need to run is held within a Private Procedure
4 the code is part of a Command button 'Click' event.

the Error I get is:
Runtime 1004 (no surprises there)
the macro in ... cannot be found

Question is, how do I run this code from another workbook.

Any help appreciated.

Cheers

Pabs
 
Hi,

Make it easy on yourself and use the SheetCodeName. THe format is
Code:
Application.Run ("'my workbook.xls'[red][b]!SheetCodeName.[/b][/red]cmdBtn_Click")


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top