PDA

View Full Version : [SOLVED:] Issue with the Auto Run Macro under Workbook Open



kelvin
11-05-2016, 12:44 AM
Hi All,

I have create a macro under 'Thisworkbook' in personal.XLSB which it will auto recall another macro "autoRefreshNoetix" at specified timing whenever workbook is open.

The reason I create this is I cannot find any other way to auto run the macro even when workbook is not open.

However, the issue I face with this macro is I have to close all excel workbook and re open any excel workbook after the pre-set timing 10:15:00 in order to make this macro auto run on the next day.

If the macro has already been executed at today 10:15:00 but without all the excel being closed/windows restart, the macro will not be executed again in subsequent day at the pre-set timing 10:15:00.

Is there solution to resolve this issue? Appreciate for your input/advice.





17516

mana
11-05-2016, 02:25 AM
Option Explicit


Sub test()


If ThisWorkbook.BuiltinDocumentProperties("Comments") = CStr(Date) Then
MsgBox "already executed today!"
Else
ThisWorkbook.BuiltinDocumentProperties("Comments") = CStr(Date)
ThisWorkbook.Save
End If

End Sub

kelvin
11-05-2016, 07:20 AM
Thanks. but seem this is not going to work as may be you have mistaken the issue I encountered.




Option Explicit


Sub test()


If ThisWorkbook.BuiltinDocumentProperties("Comments") = CStr(Date) Then
MsgBox "already executed today!"
Else
ThisWorkbook.BuiltinDocumentProperties("Comments") = CStr(Date)
ThisWorkbook.Save
End If

End Sub

p45cal
11-06-2016, 03:46 PM
cross posted at http://forum.chandoo.org/threads/issue-with-the-auto-run-macro-under-workbook-open-declare.31990/