AutoExec macro not working due to existing prompts on startup?

I'm editing a template for a client.

I've made a form that fills in certain parts of the documents, this form gets called by a module with a macro called "AutoExec".

But the macro won't execute automatically because there is already something built in the document to autoExecute.

When the template is opened (new) several prompts come up (like MSG boxes with fields).

I want to remove these prompts but they aren't inside the VBA window launched by alt f11.

Any ideas?

Answer
Answer

If you press ALT+F9 to toggle on the display of field codes when you have the template open, you will see that there are a number of FILLIN fields in the document

and it is those that are interfering with your userform.

I would remove all of those FILLIN fields and replace then with DOCVARIABLE fields and then provide controls on your UserForm into which the user can enter the information and have the Finish code populate variables in the document with that information.  I would also use DOCVARIABLE fields instead of the bookmarks that you have presently.

I would suggest that you take a look at the following pages of Greg Maxey's website

http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm

You should use one of the methods in the second article to populate the Consultant Combobox with both the name of the consultant (in one column and the telephone number in another column so that once the consultant is selected, the phone control will be populated with the phone number by accessing the information in the relevant column of the combobox.

Greg has information on his site that covers that.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 375 Applies to: