hidding xl workbooks

kxlvba

New Member
Joined
Jun 11, 2006
Messages
43
Same here I have a different issue. I'm using the following code to hide and show the excel file. For me I need to have the control to hide and show the excel file after doing something on a userform.
Using Application.Visible = True / False hides all workbooks. I just need to hide the workbook which has the form and keep rest of the open workbooks open. Any advice.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi kxlvba

You can use the window's visible property.

Try this code:

Code:
Sub HideWindow()
Dim wnd As Window

Set wnd = ActiveWindow
wnd.Visible = False
MsgBox "The window is hidden"
wnd.Visible = True

End Sub

Does this help?
PGC
 
Upvote 0
No, I have an excel file..where I've placed a button to show the form. So once the form is up, Application.Visible = False is executed within the click code and hides all excel files.
Then when I'm through filling the form and click on Close the code Application.Visible = False is executed and shows all workbooks.
So if I use the above code, after the workbook gets hidden it doesn't proceeds ahead with the remaining macro code. Gives me a runtime error 1004.
So, there should be something related to Application.Visible...which should only hide a particular workbook.
 
Upvote 0
You cannot hide a workbook. There is no visible property of a workbook. If you hide the application, you will hide everything it contains. You need to work in several instances of Excel which may be possible if a bit tricky. See this post and others.

Opening xl in hidden mode via VBS script
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

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