In an excel 2010 workbook (which I test on a local 2013 version) i have run into the following problem.
After creating a workbook(wb) i need to then close it without saving.
To do this i change DisplayAlerts to false and then back to true after closing.
This works as intended for when I delete a sheet (See below) but not when I do so for the wb later down the track.
However on a 2013 version of excel it works fine and closes the wb automatically.
Does 2010 force an alert when closing a workbook?
Or is there some setting somewhere which is forcing this behavior that can be disabled through code or manually set?
This works fine regardless of version
Application.DisplayAlerts = False
wb.Sheets(1).Delete
Application.DisplayAlerts = True
This only works on 2013
Application.DisplayAlerts = False
wb.Close
Application.DisplayAlerts = True
After creating a workbook(wb) i need to then close it without saving.
To do this i change DisplayAlerts to false and then back to true after closing.
This works as intended for when I delete a sheet (See below) but not when I do so for the wb later down the track.
However on a 2013 version of excel it works fine and closes the wb automatically.
Does 2010 force an alert when closing a workbook?
Or is there some setting somewhere which is forcing this behavior that can be disabled through code or manually set?
This works fine regardless of version
Application.DisplayAlerts = False
wb.Sheets(1).Delete
Application.DisplayAlerts = True
This only works on 2013
Application.DisplayAlerts = False
wb.Close
Application.DisplayAlerts = True