ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Save (https://www.excelbanter.com/excel-programming/375475-vba-save.html)

Zaahir

VBA Save
 
Hi
I used the ffg code,
Private Sub cmdReturn_Click()
ActiveWindow.Close([savechanges]) = False
End Sub
but it returns an error ......
"Compile Error....................Assignment to constant not permitted"
is there a different code i can use to not save a doc or just not get excel
to ask for save?

Regards

Dave Peterson

VBA Save
 
How about:

Private Sub cmdReturn_Click()
ActiveWorkbook.Close savechanges:=False
End Sub



Zaahir wrote:

Hi
I used the ffg code,
Private Sub cmdReturn_Click()
ActiveWindow.Close([savechanges]) = False
End Sub
but it returns an error ......
"Compile Error....................Assignment to constant not permitted"
is there a different code i can use to not save a doc or just not get excel
to ask for save?

Regards


--

Dave Peterson

Zaahir

VBA Save
 
Thanx david, works beautifuly

"Zaahir" wrote:

Hi
I used the ffg code,
Private Sub cmdReturn_Click()
ActiveWindow.Close([savechanges]) = False
End Sub
but it returns an error ......
"Compile Error....................Assignment to constant not permitted"
is there a different code i can use to not save a doc or just not get excel
to ask for save?

Regards



All times are GMT +1. The time now is 06:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com