#1   Report Post  
Posted to microsoft.public.excel.programming
RJH RJH is offline
external usenet poster
 
Posts: 44
Default Module call

Sometimes when I call a routine from a module I can just use the routine
name:
Sub Routine_Clcik()
Routine1
End Sub

Other times I get the error: Compile error, Expected procedure, not variable
and I have to use the module name:
Sub Routine_Click()
[Module1].Rouine1
End Sub

Why is this?

Thanks!
RJH


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Module call

If the procedure is in a class module associated with one of the worksheets
or the workbook, you have to precede it with the class (module) name.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RJH" wrote in message
...
Sometimes when I call a routine from a module I can just use the routine
name:
Sub Routine_Clcik()
Routine1
End Sub

Other times I get the error: Compile error, Expected procedure, not

variable
and I have to use the module name:
Sub Routine_Click()
[Module1].Rouine1
End Sub

Why is this?

Thanks!
RJH




  #3   Report Post  
Posted to microsoft.public.excel.programming
RJH RJH is offline
external usenet poster
 
Posts: 44
Default Module call

These aren't Class Module calls. They are calls from ordinary modules, for
example: Module1, Module2, etc..

Thanks!

RJH

"Bob Phillips" wrote in message
...
If the procedure is in a class module associated with one of the
worksheets
or the workbook, you have to precede it with the class (module) name.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RJH" wrote in message
...
Sometimes when I call a routine from a module I can just use the routine
name:
Sub Routine_Clcik()
Routine1
End Sub

Other times I get the error: Compile error, Expected procedure, not

variable
and I have to use the module name:
Sub Routine_Click()
[Module1].Rouine1
End Sub

Why is this?

Thanks!
RJH






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Module call

Are you using the same sub name in multiple modules?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RJH" wrote in message
...
These aren't Class Module calls. They are calls from ordinary modules,

for
example: Module1, Module2, etc..

Thanks!

RJH

"Bob Phillips" wrote in message
...
If the procedure is in a class module associated with one of the
worksheets
or the workbook, you have to precede it with the class (module) name.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RJH" wrote in message
...
Sometimes when I call a routine from a module I can just use the

routine
name:
Sub Routine_Clcik()
Routine1
End Sub

Other times I get the error: Compile error, Expected procedure, not

variable
and I have to use the module name:
Sub Routine_Click()
[Module1].Rouine1
End Sub

Why is this?

Thanks!
RJH








  #5   Report Post  
Posted to microsoft.public.excel.programming
RJH RJH is offline
external usenet poster
 
Posts: 44
Default Module call

No. Unique sub names in each module.

RJH


"Bob Phillips" wrote in message
...
Are you using the same sub name in multiple modules?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RJH" wrote in message
...
These aren't Class Module calls. They are calls from ordinary modules,

for
example: Module1, Module2, etc..

Thanks!

RJH

"Bob Phillips" wrote in message
...
If the procedure is in a class module associated with one of the
worksheets
or the workbook, you have to precede it with the class (module) name.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RJH" wrote in message
...
Sometimes when I call a routine from a module I can just use the

routine
name:
Sub Routine_Clcik()
Routine1
End Sub

Other times I get the error: Compile error, Expected procedure, not
variable
and I have to use the module name:
Sub Routine_Click()
[Module1].Rouine1
End Sub

Why is this?

Thanks!
RJH












Reply
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
to call procedure in a worksheet in a module CAPTGNVR Excel Discussion (Misc queries) 4 January 30th 07 09:39 PM
Remote module call Patrick Simonds Excel Programming 1 April 3rd 06 04:14 AM
How to call a sub from UserForm Module Myles[_58_] Excel Programming 1 March 31st 06 04:40 AM
Call a Module mb Excel Programming 2 October 26th 05 01:12 AM
Call other sub in the same module yangyh[_4_] Excel Programming 1 September 11th 05 09:24 AM


All times are GMT +1. The time now is 06:25 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"