Programmatically Replace VBA Code

S

Steve

I have made important changes to the VBA logic in a template. I want
that same logic to be copied to over 100 drawings that already exist.
I can open each drawing and past the new logic in, but, mercy, that
will take a long time.

Is there a way to programmatically open each existing drawing and
replace the existing VBA code with the new VBA code in a template?

Thanks.
-Steve
 
J

John

Steve,

Also look up "VBProject" in help. This is a property of the Document
object. You could write a routine in a separate document to iterate through
a group of files and replace the code using this method.

As an aside, keeping code in a stencil rather than the document is often a
better plan if you can, for reasons you are now discovering. Maybe you
could make this change now if you've got to go through the files anyway?

Hope that helps

Best regards

John
 

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