Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Ah, I think...

Hi,
yes it works much faster although It seems like the whole
application is shutting down and then reopens (which I am
not sure it is actually doing). But anyway it closes the
workbooks much faster compared to the other macro.

Many thanks again!

Jonas

-----Original Message-----
I am not sure. I think that before workbooks are closed,
they are activated, maybe not necesarily maximized. You
could try

Dim wkb As Workbook
Dim OldWinState As Long
Dim OldDispAlerts As Boolean

OldDispAlerts = Application.DisplayAlerts
Application.DisplayAlerts = False
OldWinState = Application.WindowState
Application.WindowState = xlMinimized
For Each wkb In Workbooks
If Not (wkb Is ThisWorkbook) Then
wkb.Close SaveChanges:=False
End If
Next wkb
Application.DisplayAlerts = OldDispAlerts
Application.WindowState = OldWinState

But I am not sure whether that will save you a lot of
time.

.

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



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