View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
donwb donwb is offline
external usenet poster
 
Posts: 81
Default Minimise Workbook

Hi Office_Novice
The problem with
"Application.WindowState = xlMinimized"
is that it minimises both workbooks.

Say my WorkBook #1 is active & visible
and Workbook #2 is inactive, not visible.

As soon as I run my code, I would like it to
straightaway make WB #2 visible & active then
save and close WB #1 in the "background"
so that I can look at WB #1 while that's going on.
donwb


"Office_Novice" wrote in message
...
This worked perfectly for me

Sub Shrink()
With ActiveWorkbook
Application.WindowState = xlMinimized
End With
Workbooks("Book1").Close SaveChanges:=True, Filename:="MyWorkbook"
End Sub


"donwb" wrote:

I have 2 workbooks open in Excel.
I am trying to write code to minimise the active workbook
to the taskbar, then, when it gets there, save any changes made.
I'm using:-
Application.Workbooks(MyName).WindowsState = xlMinimised
Workbooks(MyName).Close Savechanges:=True
The first line does not work, but the second one does.
Is this just syntax, or am I trying the impossible?
donwb