LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Chart Size

Hi Eric,

It is not possible to set any other attributes for the Export method, so
I use this workaround. Important: The width and height values are in
"Points", not in pixels - 1 point = 4/3 pixels! That's why I had a width
of 4800 pixels instead of 3600.


So: I did it in the same way as Jon posted below. I resize the chart in
that way that the relation between width and height is the same as
before. Important: The AutoScaleFont attribute of the chart must be set
to True.

Dim akt_x As Integer
Dim akt_y As Integer
Dim factor As Integer

akt_x = Worksheets(1).ChartObjects(1).Width
akt_y = Worksheets(1).ChartObjects(1).Height

factor = 2700 / akt_x
Worksheets(1).ChartObjects(1).Width = 2700
Worksheets(1).ChartObjects(1).Height = akt_y * factor



Then, I set the Window Zoom to 25% to enable the user to see everything.
Therefore, I have to unfocus the chart and focus a cell element, don't
know why. For me, it is important that the user can see what Excel is
doing, and if there is any display error, the user can change the chart
manually.

Worksheets(1).Range("A1").Select
ActiveWindow.Zoom = 25


Finally, I do the export to a PNG file, should also work with GIF files:

Worksheets(1).ChartObjects(1).Chart.Export _
FileName:="C:\myfile.png", _
FilterName:="PNG", _
Interactive:=True




Regards, Thomas


Eric Van Buren schrieb:
Thomas - Sorry, I don't have any experience with doing with the Export
method. Although your workaround is interesting to me. Could you
please post the complete code that you used for project to export the
gifs? Thanks.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart size Intern Charts and Charting in Excel 1 April 21st 09 04:46 PM
HOW TO FIX SIZE OF CHART BOX Khoshravan Charts and Charting in Excel 0 September 4th 07 11:36 AM
Size of Chart Paula Excel Discussion (Misc queries) 1 June 25th 07 05:04 PM
Chart size JKC Charts and Charting in Excel 1 February 14th 06 04:30 PM
specifying chart size No Name Excel Programming 3 December 23rd 03 01:09 PM


All times are GMT +1. The time now is 06:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"