Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default After module import, code does not work

I have a wb that loads in an external module from another workbook on click
of a button. It then automatically make some changes to the sheets and saves
this workbook as a different filename. Eveything works great untill I execute
the workbook_sheetselectionchange event and try to call MyModule.Thismacro
(which was imported).

If I go into the workbook_sheetselectionchange event and delete the line and
retype it exactly, it works fine!?!?! Anyone know what is going on here?

Any ideas about how to research this or fix would be great. Id like to try
and stay away from writing code to write code in thisworkbook because there
is a good amount. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default After module import, code does not work

Is it necessary to load a module? If its just the code that you need to run,
it doesn't need to be in the same book - you can save it separately as an xla
and use it whenever required


"James" wrote:

I have a wb that loads in an external module from another workbook on click
of a button. It then automatically make some changes to the sheets and saves
this workbook as a different filename. Eveything works great untill I execute
the workbook_sheetselectionchange event and try to call MyModule.Thismacro
(which was imported).

If I go into the workbook_sheetselectionchange event and delete the line and
retype it exactly, it works fine!?!?! Anyone know what is going on here?

Any ideas about how to research this or fix would be great. Id like to try
and stay away from writing code to write code in thisworkbook because there
is a good amount. Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default After module import, code does not work

yes, Id like to import the modules because they will be accessed alot when
the sheets are being used and the file is saved to another directory on a
network.

what i dont get is that if I simply retype the line "MyModule.Thismacro" ,
it works.

thanks for the reply


"Patrick Molloy" wrote:

Is it necessary to load a module? If its just the code that you need to run,
it doesn't need to be in the same book - you can save it separately as an xla
and use it whenever required


"James" wrote:

I have a wb that loads in an external module from another workbook on click
of a button. It then automatically make some changes to the sheets and saves
this workbook as a different filename. Eveything works great untill I execute
the workbook_sheetselectionchange event and try to call MyModule.Thismacro
(which was imported).

If I go into the workbook_sheetselectionchange event and delete the line and
retype it exactly, it works fine!?!?! Anyone know what is going on here?

Any ideas about how to research this or fix would be great. Id like to try
and stay away from writing code to write code in thisworkbook because there
is a good amount. Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default After module import, code does not work

Is there function that resets the code link to a module? (see below)


I have a wb that loads in an external module from another workbook on click
of a button. It then automatically make some changes to the sheets and saves
this workbook as a different filename. Eveything works great untill I execute
the workbook_sheetselectionchange event and try to call MyModule.Thismacro
(which was imported).

If I go into the workbook_sheetselectionchange event and delete the line and
retype it exactly, it works fine!?!?! Anyone know what is going on here?

Any ideas about how to research this or fix would be great. Id like to try
and stay away from writing code to write code in thisworkbook because there
is a good amount. Thanks

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
VBA code in one Module referencing Public Variables Declared inanother Module failing Khurram Excel Programming 5 March 11th 09 11:01 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
Import module then run code not working. R-Enemy[_5_] Excel Programming 0 January 11th 05 03:45 PM
Import module with vba sandy98 Excel Programming 2 November 13th 03 03:18 PM


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