-
Solved: save and rename workbook everyday at a given time
hello,
I have this code that returns me an error (can't find project ofr library) when I run "Backup_WB"
[VBA]
Private Sub Workbook_Open()
'updates R_ELN at 3.00 am and saves the workbook at XXX everyday
Application.OnTime TimeValue("3:00:00"), "ELN_Update"
Application.OnTime TimeValue("13:53:00"), "Backup_WB"
'Gets data every day (5 days in advance)
Application.OnTime Now + TimeValue("23:59:59"), "ELN_Restructuring"
End Sub
Private Sub Backup_WB()
Dim Wk As Workbook
Set Wk = Workbooks.Add
Application.DisplayAlerts = False
Wk.SaveAs Filename:="P:/Product Monitors/Backup/02 Output" & _
Format(Date, "YYYYMMDD") & " " & Format(Time, "HHMMSS") & ".xls"
End Sub
[/VBA]
does anybody know what's the problem please?
-
ok, found a glitch: I didnt haev an addin on my computer required by the spreadsheet
jsut had to set the name of the workbook too (otherwise the file was a new empty one...)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules