毎日午前9時にマクロを実行しようとしています。OnTime アプリケーションを使用しようとしており、特定の時間に起動するマクロをテストしましたが、自動的に機能しません。メッセージ ボックスをポップアップ表示するには、マクロを手動で実行する必要があります。何かアドバイス?
Sub FinancialAlert()
Application.OnTime TimeValue("15:33:00"), "Summary of Covered Companies"
Dim i As Long
i = 5
While Workbooks("Montreal Issuers.xlsm").Sheets("Summary of Covered Companies").Cells(i, 5) <> ""
With Workbooks("Montreal Issuers.xlsm")
If .Sheets("Summary of Covered Companies").Cells(i, 5).Value = 1 Then
MsgBox Workbooks("Montreal Issuers.xlsm").Sheets("Summary of Covered Companies").Cells(i, 3).Value & " is issuing their next financial statement tomorrow (" & _
Format(Workbooks("Montreal Issuers.xlsm").Sheets("Summary of Covered Companies").Cells(i, 4).Value, "[$-409]mmmm d, yyyy;@") & ")."
End If
If .Sheets("Summary of Covered Companies").Cells(i, 5).Value = 0 Then
MsgBox Workbooks("Montreal Issuers.xlsm").Sheets("Summary of Covered Companies").Cells(i, 3).Value & " is issuing their next financial statement today (" & _
Format(Workbooks("Montreal Issuers.xlsm").Sheets("Summary of Covered Companies").Cells(i, 4).Value, "[$-409]mmmm d, yyyy;@") & ")."
End If
End With
i = i + 1
Wend
End Sub