p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Access 2003 VBA Programmer's Reference (http://p2p.wrox.com/book-access-2003-vba-programmers-reference-133/)
-   -   auto macro run in Excel (http://p2p.wrox.com/book-access-2003-vba-programmers-reference/89810-auto-macro-run-excel.html)

psukanya April 9th, 2013 12:08 AM

auto macro run in Excel
 
Hi,

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.

Thanks


All times are GMT -4. The time now is 12:34 AM.

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