On Error Unhide hide Excel sheet and closed userform

ganesh_6663

New Member
Joined
Jul 15, 2021
Messages
33
Office Version
  1. 2016
Platform
  1. Windows
While running code from user form , if closed userform intermediate then it is giving run time error on "Application.Visible = True" this line and excel stay hide .
I need solution for this , on error Excel must be unhide.

by using "On Error Resume Next" application keep running but Excel not unhide .



When Userform open hide worksheet..
VBA Code:
Sub CallUserForm()

UserForm1.Show (vbModeless)
 If Workbooks.Count > 1 Then
       Windows("Upload_Final.xlsm").Visible = False
    Else
        Application.Visible = False
    End If
    UserForm1.Show (vbModeless)

End Sub


When Userform Closed Unhide worksheet....
VBA Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
'On Error Resume Next

Application.Visible = True
Windows("Upload_Final.xlsm").Visible = True


End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
How to make "Application.Visible = True" when macro stop by error...any suggestion
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top