Embedded Excel Chart Object Not Updating (1 Viewer)

sdawilson

New member
Local time
Today, 12:11
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.
 

Jon

Access World Site Owner
Staff member
Local time
Today, 12:11
Joined
Sep 28, 1999
Messages
7,384
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!
 

oleronesoftwares

Passionate Learner
Local time
Today, 04:11
Joined
Sep 22, 2014
Messages
1,159
Welcome @sdawilson to the best online forum for Ms Access Developers
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:11
Joined
May 7, 2009
Messages
19,230
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

  • OleBoundChart.zip
    69.8 KB · Views: 250

Users who are viewing this thread

Top Bottom