Set the size of a chart object

T

Thomas Wieser

Hi,

I want to set the width of an chart (with legend inside) to 3600 pixels.
I try to set it with

Worksheets(1).ChartObjects(1).Width = 3600

The problem is: When I do the Export function afterwards to save the
chart to a PNG file, the file width is 4800 pixels!


Can anyone see the error? How can I export the chart in the size I want
it to?

Thanks, Thomas
 
M

Michel Pierron

Hi Thomas;
The unit used by Excel is the point.
3600 points in pixels = 3600 * 4/3 = 4800
MP
 
M

Michel Pierron

Hi Thomas;
If you want 3600 pixels:
3600 * 3/4 =2700 points
Worksheets(1).ChartObjects(1).Width = 2700
Mp
 
T

Thomas Wieser

Hi Michel,

I see, thanks. Yes, I found out yesterday evening after my posting that
the factor must have to be 1.3 periodically - 4/3, as you mentioned.

Now I am sure - thank you!


Greetings from Austria, Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top