Excel Addin to save cell value in database periodically

pp2me11

New Member
Joined
Sep 18, 2015
Messages
1
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.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,216,487
Messages
6,130,944
Members
449,608
Latest member
jacobmudombe

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top