View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Restore Userform

It appears that your code to show the userform is in a Workbook_Open() event.
In the Visual Basic EditorProject Window, double click on ThisWorkbook and
you should see the code that has either a UserForm1.Show or ViewReports.Show.
If so, then that is where the inital display of your UserForm originates.
To show the form again after it is unloaded in the CommandButton26_Click
event, you will need to either write as special macro to show it:

Sub ShwFrm()
ViewReports.Show
End Sub

Or put the ViewReports.Show command in another macro at the place where you
want it to show. Then you will need to include code to unload it again in
either case.

"Clarissa" wrote:

Hi Everyone, Thanks in advance for any help! I have two issues,

1. I'm using a userform where the user will "view" a report in excel. When
the document is opened, the userform unloads. The user views the document
and then closes it. How can I then have the userform back on the screen
again?

2. Also, I have an Exit button which will exit the macro/workbook - exiting
the macro and closing the file. The error I get is: compile error - wrong
number of arguments or invalid property.

Here's that code:
Private Sub CommandButton3_Click()
Workbooks.Close savechanges:=False
End Sub