If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Chart resizing during macro run
I have a VBA macro that updates a chart with a new data
range every 2 minutes, and then copies the chart to a Word document for access via html/web displaying. Over time, the actual chart gets smaller and smaller in height (everything is scaled down to adjust) in the chart area. This happened with a Win98 Excel version, and still does with a new installation of Win XP Pro/Excel 2002. Is there anything I can do to stop this automatic resizing? Thanks. |
#2
|
|||
|
|||
Chart resizing during macro run
You could set the chart height during the macro:
Sheets("Sheet1").ChartObjects("Chart 1").Height = 250 Mike Green wrote: I have a VBA macro that updates a chart with a new data range every 2 minutes, and then copies the chart to a Word document for access via html/web displaying. Over time, the actual chart gets smaller and smaller in height (everything is scaled down to adjust) in the chart area. This happened with a Win98 Excel version, and still does with a new installation of Win XP Pro/Excel 2002. Is there anything I can do to stop this automatic resizing? Thanks. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#3
|
|||
|
|||
Chart resizing during macro run
I don't think this properly addressed the original question. I am
experiencing this problem too. It is not the OVERALL size of the chart that gets scaled, just the pie or bar elements INSIDE the chart. The bounding box of the chart remains the same height and width but the graphical elements get smaller and smaller within the box. I am experiencing this and there seems to be no way to lock it down, in spite of having checked all of what seem to be the appropriate boxes connected with controlling this. Bill On 9/17/03 3:45 PM, in article , "Debra Dalgleish" wrote: You could set the chart height during the macro: Sheets("Sheet1").ChartObjects("Chart 1").Height = 250 Mike Green wrote: I have a VBA macro that updates a chart with a new data range every 2 minutes, and then copies the chart to a Word document for access via html/web displaying. Over time, the actual chart gets smaller and smaller in height (everything is scaled down to adjust) in the chart area. This happened with a Win98 Excel version, and still does with a new installation of Win XP Pro/Excel 2002. Is there anything I can do to stop this automatic resizing? Thanks. |
#4
|
|||
|
|||
Chart resizing during macro run
Bill -
You just need to dive a bit deeper into the object model to find other things to set. The stuff inside a chart is resized by changing the Plot Area: With Sheets("Sheet1").ChartObjects("Chart 1").Chart.PlotArea .Top = 5 .Height = 200 .Left = 11 .Width = 315 End With I don't know why things don't stay the size you set them. I haven't had the problem that I can recall, but I've read many complaints about it. - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ how_D wrote: I don't think this properly addressed the original question. I am experiencing this problem too. It is not the OVERALL size of the chart that gets scaled, just the pie or bar elements INSIDE the chart. The bounding box of the chart remains the same height and width but the graphical elements get smaller and smaller within the box. I am experiencing this and there seems to be no way to lock it down, in spite of having checked all of what seem to be the appropriate boxes connected with controlling this. Bill On 9/17/03 3:45 PM, in article , "Debra Dalgleish" wrote: You could set the chart height during the macro: Sheets("Sheet1").ChartObjects("Chart 1").Height = 250 Mike Green wrote: I have a VBA macro that updates a chart with a new data range every 2 minutes, and then copies the chart to a Word document for access via html/web displaying. Over time, the actual chart gets smaller and smaller in height (everything is scaled down to adjust) in the chart area. This happened with a Win98 Excel version, and still does with a new installation of Win XP Pro/Excel 2002. Is there anything I can do to stop this automatic resizing? Thanks. |
Thread Tools | |
Display Modes | |
|
|