Adding code to workbooks/worksheets using VBA

  • Thread starter Thread starter Tony Bell
  • Start date Start date
T

Tony Bell

Is it possible to use VBA to write code to workbooks or
worksheets. For example, how could I write a BeforeClose
event handler to ThisWorkbook. There are a number of
workbooks that link to code I've written and I would like
to be able to automatically add code to these workbooks
when they access my code.
Can anyone help?
 
You may be better off writing a generic component (e.g. a VB6 COM
add-in or VSTO .NET project) which hooks these events rather than
embedding code in individual workbooks.
 

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