Morning,
Hoping someone can help identify how to work around this. I have the Windows 7 Task Scheduler open an excel file, it runs an on open macro that calls Refresh_all_tables, does what it needs and closes. However, it is now locked, I've tried changing the
lines around to no avail.
I am the administrator, when I open the file it says that I've locked myself out of it and can only notify (does nothing) or read-only. Requires a full restart to clear. The "~$[excel sheet name].xlsm" is on the desktop where the file is and won't allow me to delete it.
Opening the file myself works perfectly every time,
The scheduler runs fine the first time.
I do not know what to do, except double click the file every day at 4 hour intervals... (I need sleep)
Thanks for any help on the matter, here is the main set of code that drives everything and completes fine the first scheduled run or any time it is not locked by myself on my PC.
jc
Hoping someone can help identify how to work around this. I have the Windows 7 Task Scheduler open an excel file, it runs an on open macro that calls Refresh_all_tables, does what it needs and closes. However, it is now locked, I've tried changing the
Code:
Application.Quit
ThisWorkbook.Close
lines around to no avail.
I am the administrator, when I open the file it says that I've locked myself out of it and can only notify (does nothing) or read-only. Requires a full restart to clear. The "~$[excel sheet name].xlsm" is on the desktop where the file is and won't allow me to delete it.
Opening the file myself works perfectly every time,
The scheduler runs fine the first time.
I do not know what to do, except double click the file every day at 4 hour intervals... (I need sleep)
Thanks for any help on the matter, here is the main set of code that drives everything and completes fine the first scheduled run or any time it is not locked by myself on my PC.
jc
Code:
Private Sub Workbook_Open()
Call Refresh_all_tables
End Sub
Sub Refresh_all_tables()
'
' Master macro for executing everything.
'
'
Sheets("Report").Select
Range("A1").Select
ActiveWorkbook.RefreshAll
Call Filter_Accounts
Call generate_report
Call check_for_new_devices
Call Retrieve_last_replacement
Call check_warning_levels
Sleep (20000)
ThisWorkbook.Save
Application.Quit
ThisWorkbook.Close
End Sub