ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save and Close Pop Up Box...After Save and Close In VBA (https://www.excelbanter.com/excel-programming/309646-save-close-pop-up-box-after-save-close-vba.html)

Celtic_Avenger[_12_]

Save and Close Pop Up Box...After Save and Close In VBA
 
Hi Peeps........Can you help?

I have recorded a simple macro in the "Before Close" section of th
sheet, to save all work before the sheet closes,

However I have also created a active control button in one of th
sheets to save the workbook and then close it.

I need to keep both codes as they operate at separate times,

When I click the save and close button, it does all that I wan
including Saving the file, after saving it then closes the work book
but before this a pop up message asks me that a file allready exist
with the same name, do I want to overwite?

Is there any way I can stop this from poping up

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Save and Close Pop Up Box...After Save and Close In VBA
 
Use save instead of saveas.

--
Regards,
Tom Ogilvy

"Celtic_Avenger " wrote in
message ...
Hi Peeps........Can you help?

I have recorded a simple macro in the "Before Close" section of the
sheet, to save all work before the sheet closes,

However I have also created a active control button in one of the
sheets to save the workbook and then close it.

I need to keep both codes as they operate at separate times,

When I click the save and close button, it does all that I want
including Saving the file, after saving it then closes the work book,
but before this a pop up message asks me that a file allready exists
with the same name, do I want to overwite?

Is there any way I can stop this from poping up?


---
Message posted from http://www.ExcelForum.com/




Celtic_Avenger[_15_]

Save and Close Pop Up Box...After Save and Close In VBA
 
thanks......Tried that, but I think it is trying to resave when i
reached the

ActiveWindow.Close

part of the code.

anyway to stop the "A file with that name allready exists...." pop u
box?

Thanks

Celtic_Avenge

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Save and Close Pop Up Box...After Save and Close In VBA
 
the only time you get this is if you use saveas rather than save. If you
save a file, Excel doesn't raise this message. You note that save does not
take a filename while saveas does. Whether it saves twice or 20 times, you
don't get the prompt with Save. Perhaps you think you are using save - but
if you check your code I suspect you will find you are using saveas in at
least one of the routines that are being fired.

--
Regards,
Tom Ogilvy



"Celtic_Avenger " wrote in
message ...
thanks......Tried that, but I think it is trying to resave when it
reached the

ActiveWindow.Close

part of the code.

anyway to stop the "A file with that name allready exists...." pop up
box?

Thanks

Celtic_Avenger


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 05:25 PM.

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