Hi. I have a seemingly strange problem with a macro enabled workbook. In the BeforeClose sub i force the workbook to save with
However, when I try to close the workbook Excel always shows the standard Save dialogue. I've doubled checked that
when running BeforeClose sub, so the workbook definitely gets saved.
After an extensive search, I've narrowed the problem down to a sheet which contains charts. The data source for the charts is another sheet where I heavily rely on the INDIRECT function. It seems like Excel does a refresh of the charts after the workbook is saved. So if I do a copy & paste values in this sheet instead, Excel will close the book as expected without asking if I want to save the book.
I could hack this with some subs copying the formulas temporarily to another sheet and then pasting values, but that's not exactly elegant.
Any suggestions?
Code:
Me.Save
However, when I try to close the workbook Excel always shows the standard Save dialogue. I've doubled checked that
Code:
Me.Saved = True
After an extensive search, I've narrowed the problem down to a sheet which contains charts. The data source for the charts is another sheet where I heavily rely on the INDIRECT function. It seems like Excel does a refresh of the charts after the workbook is saved. So if I do a copy & paste values in this sheet instead, Excel will close the book as expected without asking if I want to save the book.
I could hack this with some subs copying the formulas temporarily to another sheet and then pasting values, but that's not exactly elegant.
Any suggestions?