LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Calling a procedure in a procedure

By default all subs are public right?

Yes.

Would having the module and the sub the same name affect it?


Yes. A module and a procedure (in any module) should never share
the same name.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Alex" wrote in message
...
hhmmm...

By default all subs are public right?

Would having the module and the sub the same name affect it?


"Norman Jones" wrote:

Hi Alex,

As Chip points out in the adjacent post, unless the called

sub is marked as
Private, the fact that the two subs are in different modules

should not pose
any problem.

Further, if the subs were marked as Private, I would expect

an error message
akin to:

Sub or Function not defined

In your described scenario I would not expect your reported

error.

--
Regards,
Norman



"Alex" wrote in message
...
I figured it out... somewhat... I have 2 different

Modules....And that was
the problem....

I needed to have the SUBs in the same Module for the

procedure to
procedure
call to work.

DOH!


"Norman Jones" wrote:

Hi Alex,

What are the names of the modules in this project?

Where are the two procedures stored?

---
Regards,
Norman



"Alex" wrote in message

...
Here's what i get when I press F1 (HELP)...

Expected variable or procedure, not module


There is no variable or procedure by this name in the

current scope,
but
there is a module by this name. This error has the

following cause and
solution:

The name of a module is used as a variable or

procedure.
Check the spelling of the variable or procedure name,

and make sure
the
name
you want to refer to isn't private to another module. A

module name
can be
a
qualifier, but can't stand alone.









 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling procedure when leaving cell jeffP Excel Worksheet Functions 5 February 9th 06 08:59 AM
Calling a procedure in a procedure N10 Excel Programming 2 August 18th 04 12:49 AM
Calling a procedure in a procedure Don Guillett[_4_] Excel Programming 1 August 17th 04 11:31 PM
Calling a .Net Procedure from a Macro Scott Eguires Excel Programming 0 December 10th 03 10:35 PM
Calling a Custom Function within a Procedure [email protected] Excel Programming 1 November 16th 03 03:51 AM


All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"