1
votes

Here is a background of my project.

I have an arduino with an LCD screen. This arduino is connected to an excel spreadsheet through a user form. The LCD screen displays values from the excel spreadsheet. If I change the value in excel, it changes the value on the LCD screen.

Taking it a step further, All of our data (for now) is in MS access, so, I imported the data from access to excel. Now, if I change a value in MS access, it changes it in excel, then changes it on the LCD screen.

This works great, but I have one issue. There is a user-form that will be continuously running (this is the connection between the arduino and excel sheet). When this form is open, the excel spreadsheet will not refresh when something in access is changed. Once I close the form, the linked table in excel will refresh.

Any ideas how to have the excel refresh the link with the form open? I have tried refreshall, updatelinks, etc. Thank you!

2
just a shot in the dark, but have you tried making the userform modeless? msdn.microsoft.com/en-us/library/office/gg251540.aspxsous2817
I haven't, but I have made it so the code runs without the form. But the excel spreadsheet won't refresh. The code loops continuously.niva5171
Can you post your code? How is the sheet being updated?sous2817
Here is the update portion. Most of the actual code was from some other person. But, here is what is being used to update the sheet, and link: ActiveWorkbook.UpdateLink ("Shelf 1") ActiveWorkbook.RefreshAll DoEvents I may be using the update link incorrectly. "Shelf 1" is the name of the linked querry.niva5171

2 Answers

0
votes

I'm assuming the user form is in Excel in which case DoEvents might be worth a try

0
votes

How about having vba code close and reopen the form periodically, the link shows how to create a timed event

VBA Macro On Timer style to run code every set number of seconds, i.e. 120 seconds