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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,215,593
Messages
6,125,715
Members
449,254
Latest member
Eva146

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