I have created an Excel Addin in VBA which reads a cell value and save in SQL database.
In Addin, I have created a VBA function SubmitCellValue in a module which can be called as =SUBMITCELLVALUE(A7) in excel and save value from A7 in database.
Above part is working fine, Now I want to add a timer of 15 minute so that after every 15 minutes value from A7 is saved in database.
I tried using Application.OnTime but its not invoking the SubmitCellValue. Code in Module is as below:
Dim SchedRecalc As Date
Function SubmitCellValue(CellValue As Double)
SchedRecalc = Now + TimeValue("00:15:00")
Application.OnTime SchedRecalc, "'SubmitPNL " & CellValue & " '"
End Function
Can anybody suggest what I am doing wrong.
In Addin, I have created a VBA function SubmitCellValue in a module which can be called as =SUBMITCELLVALUE(A7) in excel and save value from A7 in database.
Above part is working fine, Now I want to add a timer of 15 minute so that after every 15 minutes value from A7 is saved in database.
I tried using Application.OnTime but its not invoking the SubmitCellValue. Code in Module is as below:
Dim SchedRecalc As Date
Function SubmitCellValue(CellValue As Double)
SchedRecalc = Now + TimeValue("00:15:00")
Application.OnTime SchedRecalc, "'SubmitPNL " & CellValue & " '"
End Function
Can anybody suggest what I am doing wrong.