Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have written a macro that exports 44 graphs to a certain directory
under unique names. The problem hereby is that every time i use this macro, the graphs turn smaller and smaller. When the macro is used about 5 times, the graphs (piecharts) are about 40% of its original size i created them. The resizing affects not the outer graph box (title, graph, labels etc.), but only the inner graph (only piechart display) box. VBA code used. Sub ExportAllCharts() Sheets("Graphs").Select ActiveSheet.ChartObjects("Grafiek 2").Activate ActiveChart.ChartArea.Select ActiveChart.Export Filename:="W:\GEBOUW\DATAHVD\Beheer\Beheer Energie \-- Website updating--\Energy section\All Graphs\2006 PieChart Electricity DAF Hi.jpg", _ FilterName:="jpeg" ActiveSheet.ChartObjects("Grafiek 12").Activate ActiveChart.ChartArea.Select ActiveChart.Export Filename:="W:\GEBOUW\DATAHVD\Beheer\Beheer Energie \-- Website updating--\Energy section\All Graphs\2006 PieChart Gas DAF Hi.JPG", _ FilterName:="jpeg" AND THE SAME FOR ALL OTHER 42 GRAPHS :) Sheets("Macro blad").Select Range("E19").Select ActiveWorkbook.Save End VBA code example Does anyone have a solution? (NOTE: i am a beginning VBA user) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't know about the resizing. Sometimes it may be due to selecting and
deselecting the chart. This code prevents the gratuitous selection of objects, which will make the code run more quickly and make the screen remain static without flashing, and it may help with the resizing: Sheets("Graphs").ChartObjects("Grafiek 2").Chart.Export _ Filename:=sLongString, FilterName:="jpeg" Also, charts usually look better exported using the GIF or PNG filters. JPEG was designed for photographic images with gradual color transitions, not for line art. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ wrote in message oups.com... I have written a macro that exports 44 graphs to a certain directory under unique names. The problem hereby is that every time i use this macro, the graphs turn smaller and smaller. When the macro is used about 5 times, the graphs (piecharts) are about 40% of its original size i created them. The resizing affects not the outer graph box (title, graph, labels etc.), but only the inner graph (only piechart display) box. VBA code used. Sub ExportAllCharts() Sheets("Graphs").Select ActiveSheet.ChartObjects("Grafiek 2").Activate ActiveChart.ChartArea.Select ActiveChart.Export Filename:="W:\GEBOUW\DATAHVD\Beheer\Beheer Energie \-- Website updating--\Energy section\All Graphs\2006 PieChart Electricity DAF Hi.jpg", _ FilterName:="jpeg" ActiveSheet.ChartObjects("Grafiek 12").Activate ActiveChart.ChartArea.Select ActiveChart.Export Filename:="W:\GEBOUW\DATAHVD\Beheer\Beheer Energie \-- Website updating--\Energy section\All Graphs\2006 PieChart Gas DAF Hi.JPG", _ FilterName:="jpeg" AND THE SAME FOR ALL OTHER 42 GRAPHS :) Sheets("Macro blad").Select Range("E19").Select ActiveWorkbook.Save End VBA code example Does anyone have a solution? (NOTE: i am a beginning VBA user) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Exporting graphs to Word | Excel Discussion (Misc queries) | |||
Exporting Excel Graphs | Excel Programming | |||
Unwanted £ signs when exporting data from access into excel | Excel Discussion (Misc queries) | |||
Exporting EXCEL Graphs as .gif (image file) using VBA or VB | Excel Programming | |||
graphs showing unwanted zero values | Excel Discussion (Misc queries) |