ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Backup macro running twice (https://www.excelbanter.com/excel-programming/303431-backup-macro-running-twice.html)

jsollman

Backup macro running twice
 
I have a user form that pops up to ask the user if they want to back u
their file after seven days. Everything works great except the for
pops up twice no matter if they chose yes, no, or cancel.
here is the "yes" code.

Private Sub CommandButton1_Click()
Unload Me
Application.DisplayAlerts = False

ActiveWorkbook.Save
ActiveWorkbook.SaveAs ("s:\shared machining\backup\S-Bay Finis
Paint.xls")
Application.DisplayAlerts = True

ActiveWorkbook.Close
End Sub

thanks for the help
--Jeffer

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


Michel Pierron[_2_]

Backup macro running twice
 
Hi jsollman,
You can try:
ActiveWorkbook.SaveCopyAs ("s:\shared machining\backup\S-Bay FinishPaint.xls")
MP

"jsollman " a écrit dans le message de
...
I have a user form that pops up to ask the user if they want to back up
their file after seven days. Everything works great except the form
pops up twice no matter if they chose yes, no, or cancel.
here is the "yes" code.

Private Sub CommandButton1_Click()
Unload Me
Application.DisplayAlerts = False

ActiveWorkbook.Save
ActiveWorkbook.SaveAs ("s:\shared machining\backup\S-Bay Finish
Paint.xls")
Application.DisplayAlerts = True

ActiveWorkbook.Close
End Sub

thanks for the help
--Jeffery


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





All times are GMT +1. The time now is 08:57 AM.

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