DebugGalpin
Board Regular
- Joined
- Jun 29, 2011
- Messages
- 175
Good morning,
I have a macro below that I have set up for when my spreadsheet opens. It's basic steps are:-
1) Checks to see if the daily backup has been saved down.
2) If it has it does nothing
3) If it hasn't it saves a copy down in the backup location (in range M2) and then saves it down again as it's original file name which is stored in range M3.
It obviously asks me if I want it to overwrite which I do. How can I close this box automatically, everything I've tried has failed so far,
Cheers
Debug
Private Sub Workbook_Open()
Sheets("Input Sheet").Select
Calculate
'Checks to see if the file has been backed up
Application.Run ("Backup")
'If the file has been backed up it does nothing
If Sheets("Input Sheet").Range("N2") = True Then
End
Else
'If file doesn't exist it saves it down
ActiveWorkbook.SaveAs Filename:=Range("M2").Value
ActiveWorkbook.SaveAs Filename:=Range("M3").Value
End If
End Sub
I have a macro below that I have set up for when my spreadsheet opens. It's basic steps are:-
1) Checks to see if the daily backup has been saved down.
2) If it has it does nothing
3) If it hasn't it saves a copy down in the backup location (in range M2) and then saves it down again as it's original file name which is stored in range M3.
It obviously asks me if I want it to overwrite which I do. How can I close this box automatically, everything I've tried has failed so far,
Cheers
Debug
Private Sub Workbook_Open()
Sheets("Input Sheet").Select
Calculate
'Checks to see if the file has been backed up
Application.Run ("Backup")
'If the file has been backed up it does nothing
If Sheets("Input Sheet").Range("N2") = True Then
End
Else
'If file doesn't exist it saves it down
ActiveWorkbook.SaveAs Filename:=Range("M2").Value
ActiveWorkbook.SaveAs Filename:=Range("M3").Value
End If
End Sub