Okay, so my code is busily manipulating a document in Word, using objects wrdApp and wrdDoc. I don't want my user to have to stare at all the funny, busy screen activity, so I have wrdApp.Visible set to False. At the end of my procedure, I change wrdApp.Visible to True so the user can see the finished document.
The problem I'm having is this: say a user presses Cancel when my query asks for a parameter. I need to handle that error. One thing I need to handle is the fact that my procedure may have already opened one or more documents, but Word is hidden. I want to unhide Word if an error occurs so the user isn't running something hidden without knowing it.
I tried simply adding wrdApp.Visible = True into my error-handler, but I keep getting a compile error (block "with" without "end if"). Can anyone explain to me how to unhide an application on an error?
Thanks in advance for your help!