Moving Code

  • Thread starter Thread starter marston.gould
  • Start date Start date
M

marston.gould

I have a series of workbooks that are being created through a VBA tool.

In each of these workbooks, I need to place code that will execute upon
their opening and thus I need code in the This Workbook.

I've tried to think of a way to do this by moving a worksheet from my
tool into the new workbooks, but I can't seem to find a way.

Am I better off having the code in another file that my tool opens,
customizes the data in, and then closes? If so, how do I can I
temporarily turn off the code in that file while my tool dumps data and
formats in then turn it back on so that when a user opens that file,
the code executes as it should.
 
application.EnableEvents = False
' open the workbook
' process the workbook
' close the workbook
Application.EnableEvents = True
 

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

Back
Top