Ontime vba schedule on server

Jim_Doug

New Member
Joined
Aug 31, 2012
Messages
8
Hi All,

I want to schedule a report on a server PC that is always on.
The vba code has to pick up the file and save it, if available, from 05.00 till 08.00. Every day automatically.
If the file is not available the macro should re-run every 30 minute till the vba get the file or 08.00.
I wrote a macro but it doesn`t work.

Does anybody has a clue?
You would help me very much

Kind regard,
Jim

--------------------------------------------
Sub ScheduleAMacro()

Application.OnTime TimeValue("05:00:00"), "CopyFile", TimeValue("08:00:00")

Application.OnTime Now + TimeSerial(0, 30, 0), "ScheduleAMacro"

End Sub


Sub CopyFile()
Dim Link_Location_EOL_Unmatched As String
Dim Save_Location_EOL_Unmatched As String

Mail_To = Sheets("MAIN").Range("=Link_Location_EOL_Unmatched")
Mail_CC = Sheets("MAIN").Range("=Save_Location_EOL_Unmatched")

Workbooks.Open (Link_Location_EOL_Unmatched)
ActiveWorkbook.save (Save_Location_EOL_Unmatched)

End Sub
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top