Avatar of Swadhin Ray
Swadhin Ray
Flag for United States of America asked on

Macro to create Bar charts

Hello Experts,

I need some sample to read a table from a word file and generate a bar charts like below:

Chart output
And the data that will be on a word file will be as like below:

Chart Data on Word file
Is there any sample that will be help me in achieving this using Macro code. So that when ever the word file will be generated and someone opens it , the macro code will generate the chart and hide the entire table.

My Sample file will be as like the attached one.

SampleWordFile.odt

In the attached file the "Overall Risk Rating Trend" is the Dynamic chart that need to be generated using the table "Chart Data" at the end of the file.

Once the chart is generated the table should be hidden or removed.

Thanks,
Swadhin
Microsoft OfficeVB Script

Avatar of undefined
Last Comment
Swadhin Ray

8/22/2022 - Mon
Randy Downs

There are some pretty good samples here

This article contains two samples: a basic chart in Word (WordChart.docm), and a pair of files (ExcelWithChart.xlsm and WordChartLinkedToExcel.docm) that show how to have an interactive Word document that uses a chart created in Excel. You can download the code samples from the MSDN Code Gallery.
Swadhin Ray

ASKER
Say for example I build a html table in a word file with the chart data , and can we read the data from the table and build an chart dynamically.
ASKER CERTIFIED SOLUTION
Randy Downs

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Swadhin Ray

ASKER
Thanks
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes