Sparklines not refreshing while VBA is running

nherhilan

New Member
Joined
Sep 15, 2016
Messages
2
Hello all,

I automated a report in Excel that uses VBA to set some parameters, conditionally format charts, and then exports to PDF. It all works fine except for one thing: sparklines. Even though all my numbers and calculations and charts show the proper values when it gets exported to PDF, the sparklines aren't updating. I've tried DoEvents, using Waits (even for a full minute), a number of variations of Application.Calculate, zooming in/out, and keep getting the same results. And yes, I've spent hours Google-ing (Googling?) and experimenting and haven't found a solution to this.

If I step through the exact same code it works fine, but when the code runs by itself the sparklines don't update until the code ends.

Any suggestions are welcome, since I'm tearing my hair out.

Best Regards,

Nick
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi Nick

I had the same problem when I tried.

It worked for when I duplicated the DoEvents, like where I placed the DoEvents I then added another one:


Code:
' code

DoEvents
DoEvents

'code


Please try.
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,797
Members
449,337
Latest member
BBV123

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