How to fix chart size regardless of zoom?

Kelvin Stott

Active Member
Joined
Oct 26, 2010
Messages
338
Hello, I hope somebody can help:

I've written some VBA code to create a chartobject and then save it as a GIF file, which is then loaded into a user form. This all works well and the image looks perfect - however, if I change the zoom of the active worksheet before running the code, the size and resolution of the chart object and resulting image file are changed, so that it looks really bad when loaded into the user form.

Is there any way to fix the size and resolution of the chart object and image, regardless of the current zoom, so that I get consistent & predictable results?

I also tried creating the chart as a chartsheet (rather than a chart object on the current worksheet), but that has its own problems as all the text and image proportions are messed up.

Please help, thanks!
 
Last edited:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
You could run code to temporarly change the worksheet zoom to the zoom that works best for the chart display just before creating the chart and exporting it and then restore the worksheet zoom back to its original value.

Also, (Haven't tested this) but have you tried putting the chart in its own floating window ?
 
Upvote 0
You could run code to temporarly change the worksheet zoom to the zoom that works best for the chart display just before creating the chart and exporting it and then restore the worksheet zoom back to its original value.
Thanks for your response! I did try this, but it can take a while to calculate and display the chart, so you can actually see the worksheet zoom in and back out, which doesn't look very slick and professional...

Also, (Haven't tested this) but have you tried putting the chart in its own floating window ?
I did think of this and it sounds like it should work, but haven't tried it as I'm not sure how to do it?
 
Upvote 0
Thanks for your response! I did try this, but it can take a while to calculate and display the chart, so you can actually see the worksheet zoom in and back out, which doesn't look very slick and professional...

Just thinking out loud here but have you tried turning off screen updating before changing the zoom ?

Edit: Don't change the zoom before creating the chart. Change the zoom just before exporting it.
 
Upvote 0
PS. How do I put the chart in its own floating window? I like this idea also...[/QUOTE said:
Right click on the chart and select "Chart Window"
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,507
Members
452,917
Latest member
MrsMSalt

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