Still save-dialog prompt after displayalerts set to false

stef.ong

New Member
Joined
Oct 2, 2006
Messages
12
This is some code I used in a macro :

Application.DisplayAlerts = False
ActiveWindow.Close SaveChanges:=False
Application.DisplayAlerts = True

On some PC it is closing the file without prompting a dialog to save or not save the file. However on another PC it still prompt for this info ???
Same Excel 2000 SP3 is used on all 4 PC

Does anyone has a clue ??
 
Eric,

I agree but how can you do this.

If code is running and it stops itself by closing the .xls file, is there a possibility to have a post-mortem run or something like that?

In my opinion structuring will not do the trick since de code was stopped by the closing and not by getting to the end of it.

I'll checkout Thusharm's site.

Regards,
Stef.
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
In my opinion structuring will not do the trick since de code was stopped by the closing and not by getting to the end of it.
by "structure" I meant: run the code from a workbook which is NOT closed before the code reaches the end

as to open a workbook even when the sourceworkbook is closed, see this nice example :)
Code:
Sub GoodbyeAndHello()
    Application.OnTime earliesttime:=Now(), procedure:="OpenMe"
    ThisWorkbook.Close savechanges:=False
End Sub

Sub OpenMe()
    MsgBox "Hello again"
End Sub
but I would avoid this workaround-technique
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,384
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top