VBA gives wrong plotarea width?
I want to get the PlotArea width and height in order to calculate t开发者_JAVA技巧he proportion.
I used ActiveChart.PlotArea.Width
to get the width, and then tested the width using Photoshop.
I discovered that the width returned by ActiveChart.PlotArea.Width
is wrong.
Image shows what I am talking about:
I have no Idea why...
Please help me to understand why it happens and how to fix it...
Thanks!PlotArea.Width is returning the width in points not pixels. http://msdn.microsoft.com/en-us/library/ff198324.aspx
Points are a unit of length. Pixels are variable on a number of factors like monitor, fonts, truefont settings, ect. Here is a SO post about converting pixels to points: Convert Pixels to Points
精彩评论