Run a .bat file every 10 min

mattd4385

New Member
Joined
Nov 15, 2010
Messages
42
Use excel to:
Run a .bat file every 10 min until excel is closed or macro is stopped.


This is what the .bat file is doing it would be cool if it could also be done in excel without having to use a .bat file...

Pull the newest file (only one File) from a Folder Say "C:\Documents and Settings\All Users" and copy to a new location Say "C:\Temp"
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Maybe something like this... Run the 'CopyFile' macro to copy the file and schedule the macro to run every 10 minutes. Then, run StopCopyFile to end this process.

Code:
[font=Verdana][color=darkblue]Dim[/color] dt [color=darkblue]As[/color] [color=darkblue]Date[/color]

[color=darkblue]Sub[/color] CopyFile()
    [color=green]'Your code here[/color]
    dt = Now + TimeValue("00:10:00")
    Application.OnTime earliesttime:=dt, procedure:="CopyFile"
[color=darkblue]End[/color] [color=darkblue]Sub[/color]

[color=darkblue]Sub[/color] StopCopyFile()
    Application.OnTime earliesttime:=dt, procedure:="CopyFile", Schedule:=[color=darkblue]False[/color]
[color=darkblue]End[/color] Sub
[/font]
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

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