PC Review


Reply
Thread Tools Rate Thread

Arrange Icons of Minimized Excel Windows

 
 
=?Utf-8?B?Sm9obm55IE5hcGVydmlsbGU=?=
Guest
Posts: n/a
 
      5th Oct 2006
When I open one workbook in Microsoft Excel 2003 SP 2, the macro code in the
spreadsheet includes a reference to a second workbook which opens the second
workbook. When the second workbook loads, it minimizes itself. Then, I click
a button in a worksheet of the first workbook to load a third workbook, which
minimizes itself. However, the icons for the third workbook disappears behind
that for the second workbook. I can remedy this situation if I right-click on
one of the minimized workbooks and choose Arrange Icons from the
context-sensitive menu that pops up. I would like to put a command into my
program to arrange the icons immediately after the third workbook loads and
minimizes itself. I see the Windows.Arrange method, but it applies to the
open windows, not to the icons. My search of Help shows me many ways to
arrange the icons on my Windows desktop, but not within Excel. What do I need
to do? Thank you.
 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      6th Oct 2006
You can't arrange windows that are minimized, using "Windows.Arrange". If
you want easy access to all the WBs, check the Options>Shown In Taskbar,
then the Window State of a window does not matter.
Or do not minimize the window, set .WindowState = xlNormal instead, then you
can arrange them.

NickHK

"Johnny Naperville" <(E-Mail Removed)> 撰寫於郵件新聞:7B2DA136-90FF-4EA0-AF86-(E-Mail Removed)...
> When I open one workbook in Microsoft Excel 2003 SP 2, the macro code in
> the
> spreadsheet includes a reference to a second workbook which opens the
> second
> workbook. When the second workbook loads, it minimizes itself. Then, I
> click
> a button in a worksheet of the first workbook to load a third workbook,
> which
> minimizes itself. However, the icons for the third workbook disappears
> behind
> that for the second workbook. I can remedy this situation if I right-click
> on
> one of the minimized workbooks and choose Arrange Icons from the
> context-sensitive menu that pops up. I would like to put a command into my
> program to arrange the icons immediately after the third workbook loads
> and
> minimizes itself. I see the Windows.Arrange method, but it applies to the
> open windows, not to the icons. My search of Help shows me many ways to
> arrange the icons on my Windows desktop, but not within Excel. What do I
> need
> to do? Thank you.



 
Reply With Quote
 
=?Utf-8?B?Sm9obm55IE5hcGVydmlsbGU=?=
Guest
Posts: n/a
 
      6th Oct 2006
Show in Taskbar is selected in Tools | Options | View.

I would just like to know how to do programmatically what I can do manually,
if possible.

Thank you.


 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      6th Oct 2006
Johnny,
Record a macro whilst you make that change.

NickHK

"Johnny Naperville" <(E-Mail Removed)> 撰寫於郵件新聞:41049275-A8C3-46B5-8531-(E-Mail Removed)...
> Show in Taskbar is selected in Tools | Options | View.
>
> I would just like to know how to do programmatically what I can do
> manually,
> if possible.
>
> Thank you.
>
>



 
Reply With Quote
 
=?Utf-8?B?Sm9obm55IE5hcGVydmlsbGU=?=
Guest
Posts: n/a
 
      6th Oct 2006
An excellent suggestion! I found that you can arrange the icons given some
caveats.

'Line 1: Open a workbook
Workbooks.Open Filename:="C:\Work\MyWorkbook.xls"
'Line 2: Minimize it
wb.Windows(1).WindowState = xlMinimized
'Line 3: Activate a window that I know is already open and minimized
Windows("CommonCode.xls").Activate
'Line 4: Arrange the icons
Windows.Arrange ArrangeStyle:=5
'Line 5: Put the focus on an open window
Windows("AnotherWorkbook.xls").Activate

The code on Line 4 will compile regardless. However, execution will halt
with a run-time error unless the focus is on a minimized window.
 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      6th Oct 2006
Johnny,
I can't check that at the moment, but it is normally a good idea to check
the .WindowState before you try to change a window's property
Recording a macro of any action you wish to perform (but are unsure the
syntax) is always a good starting point.

NickHK

"Johnny Naperville" <(E-Mail Removed)> 撰寫於郵件新聞:FC0EF1FA-9B72-48C8-BF15-(E-Mail Removed)...
> An excellent suggestion! I found that you can arrange the icons given some
> caveats.
>
> 'Line 1: Open a workbook
> Workbooks.Open Filename:="C:\Work\MyWorkbook.xls"
> 'Line 2: Minimize it
> wb.Windows(1).WindowState = xlMinimized
> 'Line 3: Activate a window that I know is already open and minimized
> Windows("CommonCode.xls").Activate
> 'Line 4: Arrange the icons
> Windows.Arrange ArrangeStyle:=5
> 'Line 5: Put the focus on an open window
> Windows("AnotherWorkbook.xls").Activate
>
> The code on Line 4 will compile regardless. However, execution will halt
> with a run-time error unless the focus is on a minimized window.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
arrange icons/choose details in windows explorer Robin Windows XP Help 0 6th Jun 2005 12:18 PM
Re: Windows Explorer - Arrange Icons Kelly Windows XP General 2 25th Aug 2004 07:31 AM
Icons of minimized windows dont appear on my task bar Gil Windows XP Customization 1 17th May 2004 10:44 AM
Arrange Icons By -> Auto Arrange Matias Hohl Windows XP General 0 22nd Oct 2003 08:12 AM
taskbar hiding balloons when I hover over icons or minimized windows Lisa Hetherington Windows XP Basics 3 30th Sep 2003 07:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:27 PM.