p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Access 2003 VBA Programmer's Reference (http://p2p.wrox.com/forumdisplay.php?f=133)
-   -   auto macro run in Excel (http://p2p.wrox.com/showthread.php?t=89810)

psukanya April 8th, 2013 11:08 PM

auto macro run in Excel

I used this code to automate my macro
Private Sub Workbook_Open()

Application.OnTime TimeValue("08:58:00"), "RUN"
Application.OnTime TimeValue("09:00:00"), "RUN"
Application.OnTime TimeValue("10:00:00"), "RUN"
Application.OnTime TimeValue("11:50:00"), "RUN"
Application.OnTime TimeValue("12:00:00"), "RUN"
Application.OnTime TimeValue("13:00:00"), "RUN"
Application.OnTime TimeValue("13:10:00"), "RUN"
Application.OnTime TimeValue("14:00:00"), "RUN"
Application.OnTime TimeValue("15:00:00"), "RUN"
Application.OnTime TimeValue("15:33:00"), "RUN"
Application.OnTime TimeValue("16:00:00"), "RUN"
Application.OnTime TimeValue("16:30:00"), "RUN"
Application.OnTime TimeValue("17:00:00"), "RUN"
Application.OnTime TimeValue("17:30:00"), "RUN"
Application.OnTime TimeValue("18:00:00"), "RUN"
Application.OnTime TimeValue("19:00:00"), "RUN"
Application.OnTime TimeValue("20:00:00"), "RUN"

End Sub
Sub RunAMacro()

Application.RUN "path'!RUN"

End Sub

But the problem is...If my cursor is placed on other excel sheet at above mentioned time then macro executed in that sheet not in 'Path'
Could any one suggest the currect code.
*Path - File path
*Run - Macro name

I guess one loop is required to identify the file..Please suggest me and suggest me how to minimize the code to auto run the macro with 15min interval.


All times are GMT -4. The time now is 07:57 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.