Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default minimize just opened workbook window

In an Open event subroutine for "workbook1", I open a second workbook
"workbook2" that is defined by label "book2" in a "workbook1" worksheet with
the following statements:

Dim wkbook2 as object
Set wkbook2 = Range("book2")
Workbook.Open (wkbook2)

Question: How do I minimize (xlMinimize) the window for the just opened
"workbook2" using the label "book2" defined in "workbook1"?

Workbooks(wkbook2).ActiveWindow.WindowState = xlMinimized

Above statement does not work.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default minimize just opened workbook window

A couple of things... wkbook2 is pointing at a range and not at the workbook
as you might expect it is. Secondly when you open a workbook it is opened in
the active window so to hide it you just need ActiveWindow.WindowState =
xlMinimized. Give this a try...

Dim wkbook2 as Workbook
Workbook.Open (Range("book2").Value)
Set wkbook2 = ActiveWorkbook
ActiveWindow.WindowState = xlMinimized

--
HTH...

Jim Thomlinson


"JohnZ" wrote:

In an Open event subroutine for "workbook1", I open a second workbook
"workbook2" that is defined by label "book2" in a "workbook1" worksheet with
the following statements:

Dim wkbook2 as object
Set wkbook2 = Range("book2")
Workbook.Open (wkbook2)

Question: How do I minimize (xlMinimize) the window for the just opened
"workbook2" using the label "book2" defined in "workbook1"?

Workbooks(wkbook2).ActiveWindow.WindowState = xlMinimized

Above statement does not work.

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
show minimize window selection for Excel Spence Excel Discussion (Misc queries) 0 May 18th 10 04:44 PM
Excel 03 - Send Attachment (can't minimize Outlook window) KKate Excel Discussion (Misc queries) 0 August 10th 07 01:20 AM
how do i minimize/maximize a workbook from vba? I want to minimize it durring processing to speed things up a bit Daniel Excel Worksheet Functions 2 July 9th 05 03:35 AM
How to see if the opened workbook is opened by another user ? balexis Excel Programming 1 August 18th 04 04:11 PM
window minimize Tom Ogilvy Excel Programming 4 July 18th 03 03:38 PM


All times are GMT +1. The time now is 03:22 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"