disappearing procedure

D

Denis

I have a procedure called Report_Extend that looks like this:

Sub Report_Extend(datearr As Variant)

End Sub

Sub testextend()
Dim datearr(5) As Date

Report_Extend datearr
End Sub

This code compiles without complaint. However, when I try to run
Report_Extend via Tools/Macro/Macros, Report_Extend does not appear in
the select list. On the other hand I have a test procedure called
testextend (shown above) and I can run it which calls Report_Extend
and everything works fine.

If I change the definition of Report_Extend to have no parameter:

Sub Report_Extend()

then it appears in the Tools/Macro/Macros list, but then doesn't work
since it needs the array parameter.

Anybody know why this Report_Extend disappears when I include its
parameter declaration? This is using Excel 2003 SP3.

Denis
 
J

James Ravenswood

I have a procedure called Report_Extend that looks like this:

Sub Report_Extend(datearr As Variant)

End Sub

Sub testextend()
    Dim datearr(5) As Date

    Report_Extend datearr
End Sub

This code compiles without complaint.  However, when I try to run
Report_Extend via Tools/Macro/Macros, Report_Extend does not appear in
the select list.  On the other hand I have a test procedure called
testextend (shown above) and I can run it which calls Report_Extend
and everything works fine.

If I change the definition of Report_Extend to have no parameter:

Sub Report_Extend()

then it appears in the Tools/Macro/Macros list, but then doesn't work
since it needs the array parameter.

Anybody know why this Report_Extend disappears when I include its
parameter declaration?  This is using Excel 2003 SP3.

Denis

I don't believe that you can directly run a sub that needs arguments
as the UI has no mechanism to supply them. As you pointed out, you
need a :helper" macro to supply the inputs.
 
D

Denis

I don't believe that you can directly run a sub that needs arguments
as the UI has no mechanism to supply them.  As you pointed out, you
need a :helper" macro to supply the inputs.

Well, of course, you can't run such a procedure directly. Thanks for
pointing out what I should have been able to figure out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top