Embedded Excel Chart Object Not Updating

sdawilson

New member
Local time
Today, 07:38
Joined
Feb 20, 2022
Messages
6
Hi all,

This is driving me mad... I've been searching the forum all morning, but can't find a solution.

I have an embedded (unbound object frame) Excel Chart (XY Scatter) and I'm trying to get it to update the displayed object after I have made changes to the underlying chart object. Here's my code:

Sub Test()

Dim pWorkbook As Excel.Workbook
Dim CHT As Excel.Chart

Forms![frm_Dashboard]![OLEScatterPlot].Action = acOLEUpdate


Set pWorkbook = Forms![frm_Dashboard]![OLEScatterPlot].Object
Set CHT = pWorkbook.Charts(1)
CHT.ChartTitle.Text = "New Text Goes Here"
pWorkbook.Save

Forms![frm_Dashboard]![OLEScatterPlot].Action = acOLEUpdate

Set pWorkbook = Nothing

End Sub


This used to be easy when Access had pivot charts... but alas.

I remember finding a fix for this years ago, but I can't remember how I did it. I've tried "Graph" but the output is hideous.

Any help would be greatly appreciated.
 
Welcome to the forums! We are the most active Microsoft Access community on the internet by far, with posts going back over 20 years!

To get started, I highly recommend you read the post below. It contains important information for all new users to this forum.

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We look forward to having you around here, learning stuff and having fun!
 
Welcome @sdawilson to the best online forum for Ms Access Developers
 
you need to use Bound Object frame so that it the Chart can be updated (not static).
see this demo and put All files on Same folder.
 

Attachments

Users who are viewing this thread

Back
Top Bottom