Hi,
I'm getting the following message appear: -
The code for the Timer I've taken from the link supplied in the following post http://www.mrexcel.com/forum/excel-questions/351089-how-do-i-make-macro-run-every-minute.html and I've used the example from Pearson Software Consulting
Here is the code I've got in my Module: -
Sheet2 Code: -
I've tried various things in the Trust Center including checking "Enable all macros (not recommended; potentially dangerous code can run)" under Macro Settings, but the same message appears?
Have I missed something?
The method I'm using seems to be a very common with numerous examples on the internet, so I'm at a loss as to why I'm unable to get it to run.
Any help, assistance, thoughts or suggestions most welcome!
Thanks & Regards
I'm getting the following message appear: -
Cannot run the macro "C:\Path\Workbook'!SubName'. The macro may not be available in the workbook or all macros may be disabled.
The code for the Timer I've taken from the link supplied in the following post http://www.mrexcel.com/forum/excel-questions/351089-how-do-i-make-macro-run-every-minute.html and I've used the example from Pearson Software Consulting
Here is the code I've got in my Module: -
Code:
Option Explicit
Public RunWhen As Double
Public Const cRunIntervalSeconds = 30
Public Const cRunWhat = "CheckLocation"
Sheet2 Code: -
Code:
Option Explicit
Dim strCurrSystem As String
Sub CheckLocation()
strLogPath = Sheet3.Cells(3, 2)
'* Inform User of Check
lblInformation.Caption = "Establishing Current Location..."
strCurrSystem = Location
lblInformation.Caption = ""
Sheet2.Cells(5, 2).Value = strCurrSystem
Call StartTimer
End Sub
Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime RunWhen, cRunWhat, , True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime RunWhen, cRunWhat, , False
End Sub
I've tried various things in the Trust Center including checking "Enable all macros (not recommended; potentially dangerous code can run)" under Macro Settings, but the same message appears?
Have I missed something?
The method I'm using seems to be a very common with numerous examples on the internet, so I'm at a loss as to why I'm unable to get it to run.
Any help, assistance, thoughts or suggestions most welcome!
Thanks & Regards