#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Hide Workbook

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
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
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 157
Default Hide Workbook

Worksheets("Sheet1").Visible = False

Bear in mind that Excel must have at least one worksheet visible.

Another alternative might be to reduce the window size so it is hidden
behind the userform.

Assuming the code is in the active worksheet:

With ActiveWindow
.WindowState = xlNormal
.Top = 100
.Left = 250
.Height = 100
.Width = 100
End With
UserForm1.Show

--
Ian
--

"aftamath77" wrote in message
...
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.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Hide Workbook

Try this from another workbook
Workbooks("WkbNameHere").window(1).hidden = True

or

Windows("WkbNameHere.xls").Visible = False

--
To get my email id paste my address in an Excel cell and press Enter...


"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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hide workbook behind chart Whiley E Coyote Charts and Charting in Excel 1 January 19th 08 01:12 AM
I cannot hide a sheet in a workbook. Why? JRC Excel Worksheet Functions 9 October 10th 06 05:54 PM
Open and Hide a workbook MBum Excel Discussion (Misc queries) 1 July 11th 06 06:47 PM
Can I hide certain information within a workbook? mikie Excel Discussion (Misc queries) 2 February 28th 05 10:15 PM
I cant hide a workbook Steve Excel Worksheet Functions 3 November 30th 04 01:05 AM


All times are GMT +1. The time now is 10:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"