PDA

View Full Version : Help with Run Time Error 1004 Document Not Saved



Panda
11-16-2011, 08:47 AM
Hi There

For a project at work I am trying to get a spreadsheet to save to an area on the network every 10 minutes so have entered in the code detailed below to do so.


Dim TimeToRun
Sub Auto_Open()
Call Schedule_Save
End Sub
Sub Schedule_Save()
TimeToRun = Now + TimeValue("00:10:00")
Application.OnTime TimeToRun, "Save_Spreadsheet"
End Sub
Sub Save_Spreadsheet()
'ActiveWorkbook.Save
Application.DisplayAlerts = False 'Turns off the 'Are you sure you want to overwrite this file alert box
'Updated Save Workbook code to work with WYSE (Citrix) Terminals
ActiveWorkbook.SaveAs ActiveWorkbook.Path & "\Oven Log V22.xls"
Application.DisplayAlerts = True 'Turns back on any alerts, so user will be able to see them in the future
Call Schedule_Save
End Sub
Sub Auto_Close()
Application.OnTime TimeToRun, "Save_Spreadsheet", , False
End Sub




However, intermittently I will get a debug message stating ‘Error 1004’ document could not be saved? Have I not done something in order for this to happen?

Thanking you in advance

Panda