#1
|
|||
|
|||
Keeping Macros/VBA with document
I had an interesting surprise when I got home and pulled up my network stored .docx document over the company VPN to find that all my VBA code was inaccessible! How can I bind all my VBA code for this project to this one particular document? When I complete my code and I assign to, say a button and then deliver it to a co-worker, how to I ensure every bit if intended code runs on the delivered document? As I mentioned above, this document is stored on our network an I need anyone on the network who pulls it up to be able to run the code intended for it?
|
#2
|
|||
|
|||
Simply put the code modules into the document instead of Normal.
|
#3
|
|||
|
|||
Yeah I came to that solution a few minutes ago as my VBA memory comes back. I even see how/where to do it. Thanks.
|
#4
|
||||
|
||||
FWIW docx files cannot contain macro code. To include macros in such a document, it must be saved in the docm format and have the relevant code added to it - not just to its template.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Yes, I know that. I was neglectful in my use of the wrong file extension. Thanks.
|
#6
|
|||
|
|||
Hi You need to open a document in which you want to embed VBA code. In Microsoft Word, go to the "Developer" tab and click on the "Edit Code" button. Write or paste your code into the VBA editor window. After writing the code, save the document in .docm format (a document with macros enabled).
|
#7
|
||||
|
||||
TessaMurillo: I have noticed quite a few posts by you that are either not at all relevant to the topic under discussion (e.g. posting Excel formula-based solutions to Word questions) or, like the one above, being little more than parroting what has already been discussed, including in threads already marked as solved (like this one).
Kindly keep your posts on-topic and substantive, otherwise you might find your posting privileges restricted.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merging different documents in one big document keeping the chapters, figure numbers and tables | village | Word | 8 | 06-06-2016 04:16 AM |
Word document with Macros with trusted locatin versus Word document 1997-2003 | Cardinal2 | Word | 1 | 11-30-2015 07:42 PM |
Merging Word documents and keeping the formatting exactly as it appears in the original document | NovaScotia | Word | 4 | 01-21-2015 11:44 PM |
Keeping exact layout of source document when I copy and paste | mjbowen147 | Word | 1 | 11-17-2013 02:08 PM |
arabic word document to notepad WHILE KEEPING ENCODING! | wildheart25c | Word | 8 | 03-14-2012 07:58 AM |