![]() |
|
#6
|
||||
|
||||
|
This error occurs when the userform has been unloaded before the rest of the code can complete. My guess is that you clicked the cross in the top right of the userform to close the form. To overcome this add the following to the userform code
Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
CommandButtonCancel_Click
Cancel = True
End If
lbl_Exit:
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cross Referencing Bookmarks populated from a userform Word 2010 | arbluecreek | Word VBA | 6 | 06-05-2015 05:29 AM |
| Update Bookmarks from a Userform | alshcover | Word VBA | 12 | 01-12-2015 06:53 PM |
send a string from Excel UserForm to Word
|
saltlakebuffalo | Excel Programming | 1 | 02-10-2014 11:01 PM |
Auto Populate Word From to Excel File
|
webber | Word | 1 | 10-02-2013 02:52 PM |
| How do I use an Excel form to populate and Excel spreadsheet | apostht | Excel | 0 | 05-21-2006 11:17 AM |