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!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Use the Query_Close event of the UserForm

Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Application.Visible = True
End Sub
 
Upvote 0
I can't access the UserForm (I don't think). I closed VBE so the entire application is hidden including any modules/forms.
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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