After module import, code does not work

J

James

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
 
P

Patrick Molloy

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
 
J

James

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
 

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