Importing a macro programatically

J

john

I have a conundrum. My application loads a csv file into excel and does
some bits and bobs to it. In doing so it imports a macro from a text
file runs the code and exports it again That works fine. However it
does this before displaying the data sheet.

What I want to do is to import some code which will remain active and
allow the user to interact once it is loaded. I also import a worksheet
as a summary page during the process and have tried importing a macro
with this. This imports but the scope of the macro is such that I
cannot use it to manipulate another sheet.

If I use an add-in I would need to reference the addin in teh
workbook. The workbook is created new each time and so this wouldn't
work. Can I make a macro in a worksheet become public?

COuld I move it programatically to the other sheet I need to use it in?
The application cunningly removes all extraneous modules added as it is
working so even if I could add a new module it would get removed.

Could I add a procedure to the existing module? It is a complex issue
and I hope I have made it clear. I am limited by the way the
application works and cannot re-write that as it would upset everything
else!
John Robinson
 

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