Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-12-2018, 01:33 PM
LimpingBuf LimpingBuf is offline Showing userform in document open results in error message Windows 10 Showing userform in document open results in error message Office 2016
Novice
Showing userform in document open results in error message
 
Join Date: Feb 2007
Posts: 3
LimpingBuf
Default Showing userform in document open results in error message

This should be easy but I can't make it work. I would like to distribute to outside clients templates of various contracts we have created for them. I have created a template (call it the "parent template") that holds a form that populates a list box with the template names and allows the user to select a template and create a new contract based on the selected template.

The form itself works fine when activated from a macro when the parent template is open. However, when I try to open the form using the document open event based in the parent template, I get a message saying:

"You cannot close Microsoft Word because a dialog box is open. Click ok, switch to Word, and then close the dialog box."

Either X'ing out or clicking on ok puts me into the form and everything works fine from that point in.



The other point to be aware of that may be a factor is that after the new document is created, the form is closed and the parent template is closed.

I use a similar system to allow people within my firm to access contract templates and it works quite well. However, in our firm we distribute a parent template that is loaded into word at startup. A macro is installed on the user's toolbar and that activates and shows the selection form. Unlike the client project, our internal project does not close the parent template.

A long winded question, but hopefully that gives you an idea of what I trying to do. I suspect that there is an easy fix, but i can't find it.
Reply With Quote
  #2  
Old 07-12-2018, 07:58 PM
Guessed's Avatar
Guessed Guessed is offline Showing userform in document open results in error message Windows 10 Showing userform in document open results in error message Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I think you have two choices:
1. Distribute the addin to the clients and help them install it in their startup folder
2. Bring all the "contracts" into a single template (by saving each as a quick part) then either:
- teach the users how to select the relevant contract from the quick parts
- add a startup macro that displays a userform which lists the available quick parts and lets them choose one to insert.

I would normally do the second option because I don't like having progressively bigger and bigger sets of files where minor edits need to be repeated in all the files.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 07-13-2018, 07:28 AM
LimpingBuf LimpingBuf is offline Showing userform in document open results in error message Windows 10 Showing userform in document open results in error message Office 2016
Novice
Showing userform in document open results in error message
 
Join Date: Feb 2007
Posts: 3
LimpingBuf
Default

Thank you for the response.


Essentially what I am doing is what you suggested as option number 2. I have a userform that I want to load at start up. The startup procedure is simply to show the userform. MS Word won't let the form load. If the user simply clicks thru the message about not being able to close word, the useform loads and it works fine. Is there some trick to showing userforms at startup?

Thanks for the help.
Reply With Quote
  #4  
Old 07-13-2018, 06:42 PM
Guessed's Avatar
Guessed Guessed is offline Showing userform in document open results in error message Windows 10 Showing userform in document open results in error message Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I think you missed the point of what I was saying. My #2 method is not opening two documents and closing one. It is just opening one document. This would mean there doesn't need to be a parent template which opens a secondary template.

Showing a userform at startup is pretty simple, just name the macro that calls it either AutoOpen or AutoNew depending on whether you want to see it every time you open the doc or just when you are creating a new file.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error message when trying to open excel file Glenda Excel 1 08-03-2015 07:12 AM
Showing userform in document open results in error message Error message opening a document in Word "Word cannot open this file because it is larger than 512 M poonamshedge Word 2 09-11-2014 06:11 AM
Change focus from userForm back to word document to see results. Hank Smith Word VBA 1 08-11-2014 05:00 AM
Showing userform in document open results in error message Automation error Unknown error" message once they open the Excel file hlina Excel 1 10-08-2013 09:14 PM
Repair command results in error message srdiamond Office 0 03-01-2011 12:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft