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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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