![]() |
|
#1
|
|||
|
|||
![]()
In a previous post, I learned why the macro to open a userform was not visible in the project explorer (the macro created the form on the fly).
Using the organizer, I moved the macro to a new template, but the form doesn’t open when I open a new document based on the template. I have also tried saving the old template as a 2010 template, and it still doesn’t open the form. Something must be missing to make the macro work in the new template, but I don’t know enough about VBA to figure out what it is. As I said before, the macro is visible in the code window but doesn’t appear in the project explorer. Thanks for your help. |
#2
|
||||
|
||||
![]()
Your old macro was in a code module named AutoNew. To export the sub and maintain its functionality, you probably needed to export the whole AutoNew module, then re-import the module into the new template - or you could simply open the template and use SaveAs to save it in the .dotm format. Unless you do either of those things, you'll need to rename the macro from 'Main' to 'AutoNew' or, if you've added it to the template's 'ThisDocument' module, 'Document_New'
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Tags |
userform |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
rvessio | Word VBA | 4 | 07-25-2016 12:37 PM |
![]() |
rslck | Outlook | 1 | 06-19-2014 10:16 AM |
VBA code to update record in Access 2003 using Userform in Excel | primmer3001 | Excel Programming | 0 | 08-29-2011 04:25 PM |
Word doc bug when closing from userform command button click macro | Joe Patrick | Word | 1 | 07-05-2011 08:53 PM |
[Word 2003] Macro's and a UserForm | xanuex | Word VBA | 0 | 10-19-2009 05:42 AM |