set app.vis=false then closed VBA! How to get wrkbk visible?

joefrench

Active Member
Joined
Oct 4, 2006
Messages
357
I've just run some code that sets Application.visible=false and loads a userform. I then closed both the userform & vbeditor :oops: . I've actually done this before and was able to get the app back but do not remember how. Any ideas out there? The actual workbook is still in session. I have tried the following with no results:
Code:
For Each Workbook In Workbooks
If Workbooks.Application.Visible = False Then
Workbooks.Application.Visible = True
End If
Next

Any suggestions would be greatly appreciated!
 

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

royUK

Well-known Member
Joined
Jul 24, 2002
Messages
1,606
Use the Query_Close event of the UserForm

Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Application.Visible = True
End Sub
 

joefrench

Active Member
Joined
Oct 4, 2006
Messages
357
I can't access the UserForm (I don't think). I closed VBE so the entire application is hidden including any modules/forms.
 

joefrench

Active Member
Joined
Oct 4, 2006
Messages
357
The following opened the file but was not the version in session:
Code:
Application.Workbooks.open ("Directory\Program.xls")

Maybe there is something similar which will set the filename visibility to True?
 

joefrench

Active Member
Joined
Oct 4, 2006
Messages
357

ADVERTISEMENT

In the task manager, I can see the UserForm. I can also see it through Alt+Tab. There's gotta be a way I can either make the UserForm visible or the Workbook visible.
 

joefrench

Active Member
Joined
Oct 4, 2006
Messages
357
WOW do I feel like an idiot......... :oops: :oops: :unsure:

If this happens to anyone else, try going to the directory in which your file is stored and double click (open) the file.
 

royUK

Well-known Member
Joined
Jul 24, 2002
Messages
1,606

ADVERTISEMENT

Sorry, I thought you wanted code to avooid this. You could actually place the code I posted in the UserForm_Click event whilst developing to avoid this.
 

tusharm

MrExcel MVP
Joined
May 28, 2002
Messages
11,028
Even better...don't hide the application!
WOW do I feel like an idiot......... :oops: :oops: :unsure:

If this happens to anyone else, try going to the directory in which your file is stored and double click (open) the file.
 

joefrench

Active Member
Joined
Oct 4, 2006
Messages
357
royUK - Thank you. That will be handy during development.

Tushar - Believe me, I'd rather not hide the app....unfortunately the person that I am developing this for is not too computer savvy and at the same time, extremely click happy. I'm planning on hiding the app and having her work through a userform to avoid confusion/problems.

VOG II - Thank you. I actually have some similar code to maximize the UserForm. I still think that I want to hide the app....I just need to be a bit more careful myself during development.

Thank you all.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,470
Messages
5,601,840
Members
414,479
Latest member
Beau the dog

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
Top