Thread: Hide Workbook
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Hide Workbook

The workbook that contains the userform?

dim myWindow as window
for each mywindow in thisworkbook.windows
mywindow.visible = false
next mywindow

Change
thisworkbook.windows
to
activeworkbook.windows
if you want the activeworkbook's windows hidden.

===
If there's only one window for that workbook:
thisworkbook.windows(1).visible = false



aftamath77 wrote:

I would like to write code that will hide a specific workbook when a userform
pops up. I tried:

Application.Visible = False

That works fine except, it hides Excel completely. I would like to hide
only the workbook that contains the userform.


--

Dave Peterson