Save "chart in microsoft word" as macro enabled file

JennyLyons

New Member
Joined
Dec 18, 2017
Messages
6
Hello!

I am working on a project where I am building charts in a Word file through the embedded Excel feature. Each chart in the Word file has its own mini Excel document. I found some code I was using on another project where, using VBA, it sets the chart axis min and max based on a cell value. I want this to happen in the embedded Excel documents in the Word file, but I cannot figure out how to make it happen. I saved the Word file as a macro-enabled document. I go into the embedded chart Excel file and add the VBA module and code. It works fine. The problem is when I exit, it does not seem to save the code in the mini Excel file. When I open it back up, the module is gone. My suspicion is that even though the main Word file is saved as macro-enabled, the mini backend Excel documents are not.

Can anyone help me solve this?

Thanks so much!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Any code you use for this has to be saved in the Word document, not in the embedded object, and requires the object to be automated for use.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

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