Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 183
Default Module Names11

Hi - I have a pile of modules in my Excel workbook. I was copying some
others from another workbook. So now I have some modules, not all, being
named "Module2.All" rather than just "All". I can't find any rename option
for the modules and of course any procedure that calls them can't find them,
nor will the procedures recognise Module2.All. If anybody has any ideas I
would be really grateful.
--
Sharon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Module Names11

in the project explorer, click on the module name in the Tree (expand the
mdule branch if necessary). Then make the properties window visible (F4 or
View=Properties Window). The property window of the Module has its name.
Highlight Module2.All and type in a new name.

--
Regards,
Tom Ogilvy


"Sharon" wrote:

Hi - I have a pile of modules in my Excel workbook. I was copying some
others from another workbook. So now I have some modules, not all, being
named "Module2.All" rather than just "All". I can't find any rename option
for the modules and of course any procedure that calls them can't find them,
nor will the procedures recognise Module2.All. If anybody has any ideas I
would be really grateful.
--
Sharon

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 183
Default Module Names11

Hi Tom

Thanks for that. In fact the name in the properties window is showing as
Module2. The Sub is called All. So when I changed Module2 to All, it is now
seeing the module as All.All . Am I missing something (nothing new for me!).

--
Sharon


"Tom Ogilvy" wrote:

in the project explorer, click on the module name in the Tree (expand the
mdule branch if necessary). Then make the properties window visible (F4 or
View=Properties Window). The property window of the Module has its name.
Highlight Module2.All and type in a new name.

--
Regards,
Tom Ogilvy


"Sharon" wrote:

Hi - I have a pile of modules in my Excel workbook. I was copying some
others from another workbook. So now I have some modules, not all, being
named "Module2.All" rather than just "All". I can't find any rename option
for the modules and of course any procedure that calls them can't find them,
nor will the procedures recognise Module2.All. If anybody has any ideas I
would be really grateful.
--
Sharon

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Module Names11

Yes. You are missing a clear explanation of your problem. You stated you
wanted to rename your module for which I gave you the correct answer.

It now appears that what you were originally talking about was what you see
in Tools=Macro=Macros where you see
Module1.All
Module2.All
And you wanted to rename your procedure so it didn't have the Module2. this
is unnecessary.

Possibly. When you imported modules into your workbook, they had duplicate
macro names. Excel adds the module designation in Tools=Macro=Macros so
you can tell which one you want to run. Selecting it and hitting run should
cause no problem.

In the case of the module you renamed, you should change the module name
back to module2 or something unique. You should not have a Sub named the
same as the module name. If you want to rename your subs/procedures, just
edit their declaration in the module. (but this should not be necessary)

Sub MyMacro()

End sub

would be renamed by changing MyMacro to something else.

Your statement that Module2.All doesn't work is incorrect. As an example,

Module1:
Sub EFG()
MsgBox "In Module1"
End Sub

Module2:
Sub EFG()
MsgBox "In Module2"
End Sub

Sub ABB()
Module2.EFG
Module1.EFG
End Sub

When I run ABB, it first executes the EFG in Module2, then it executes the
EFG in Module1.

However, since ABB is in Module2,

Sub ABB()
EFG
Module1.EFG
End Sub

Works exactly the same since it look at its own module first.

For procedures with duplicate names, if they are external to the module of
the calling procedure, they should include the module name.

--
Regards,
Tom Ogilvy





"Sharon" wrote:

Hi Tom

Thanks for that. In fact the name in the properties window is showing as
Module2. The Sub is called All. So when I changed Module2 to All, it is now
seeing the module as All.All . Am I missing something (nothing new for me!).

--
Sharon


"Tom Ogilvy" wrote:

in the project explorer, click on the module name in the Tree (expand the
mdule branch if necessary). Then make the properties window visible (F4 or
View=Properties Window). The property window of the Module has its name.
Highlight Module2.All and type in a new name.

--
Regards,
Tom Ogilvy


"Sharon" wrote:

Hi - I have a pile of modules in my Excel workbook. I was copying some
others from another workbook. So now I have some modules, not all, being
named "Module2.All" rather than just "All". I can't find any rename option
for the modules and of course any procedure that calls them can't find them,
nor will the procedures recognise Module2.All. If anybody has any ideas I
would be really grateful.
--
Sharon

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
Calling worksheet module from other module. Michael Malinsky Excel Programming 2 December 14th 05 08:47 PM
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
Calls from sheet module to ThisWorkbook module quartz[_2_] Excel Programming 2 June 23rd 05 03:37 PM
Variable from a sheet module in a class module in XL XP hglamy[_2_] Excel Programming 2 October 14th 03 05:48 PM


All times are GMT +1. The time now is 09:04 AM.

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"