View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_5_] Stuart[_5_] is offline
external usenet poster
 
Posts: 413
Default Problems running a sub having arguments

The Run statement worked fine.

Many thanks.

Regards.

"Dave Peterson" wrote in message
...
Without taking time to setup variables (I passed all strings), this worked

ok:

Option Explicit
Sub testme()

Dim myCell As String
Dim ws As String
Dim myCol As String

myCell = "hi"
ws = "there"
myCol = "!"
Application.Run _
"book3.xla!InDirect_Menu_Routines.ReNumberBofQPage s", _
myCell, ws, myCol

End Sub

And the macro looked like:
Option Explicit
Sub ReNumberBofQPages(myCell As String, ws As String, myCol As String)
MsgBox myCell & "--" & ws & "--" & myCol
End Sub


Stuart wrote:

From the Immediate window, this statement:

Application.Run "BofQUtilities.xla!InDirect_Menu_Routines.Test 1"

results in the following macro successfully running:

Sub Test1()
MsgBox ("Success")
End Sub

but this statement:

Application.Run _

"BofQUtilities.xla!InDirect_Menu_Routines.ReNumber BofQPages(myCell, ws,
£Col)"

results in an error message, saying the macro cannot be found.

The macro exists, and I'm fairly sure there are no typos.

Any ideas please?

Regards.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.524 / Virus Database: 321 - Release Date: 06/10/2003


--

Dave Peterson



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.524 / Virus Database: 321 - Release Date: 06/10/2003