Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I resize the active Chart if the Chart name changes each time one is
generated. ' ActiveSheet.Shapes("Chart 88").ScaleWidth 1.46, msoFalse, _ ' msoScaleFromBottomRight ' ActiveSheet.Shapes("Chart 88").ScaleHeight 1.22, msoFalse, _ ' msoScaleFromBottomRight ' ActiveSheet.Shapes("Chart 88").ScaleWidth 1.29, msoFalse, msoScaleFromTopLeft Next time I generate a chart, it is not "Chart 88" anymore and returns an error. Thanks. -Randy- |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not certain of when you're wanting to change the dimensions, but...
You might be able to use ActiveChart instead of ActiveShet.Shapes("Chart 88") "Randal W. Hozeski" wrote in message news:RkuHb.59405$VB2.112857@attbi_s51... How do I resize the active Chart if the Chart name changes each time one is generated. ' ActiveSheet.Shapes("Chart 88").ScaleWidth 1.46, msoFalse, _ ' msoScaleFromBottomRight ' ActiveSheet.Shapes("Chart 88").ScaleHeight 1.22, msoFalse, _ ' msoScaleFromBottomRight ' ActiveSheet.Shapes("Chart 88").ScaleWidth 1.29, msoFalse, msoScaleFromTopLeft Next time I generate a chart, it is not "Chart 88" anymore and returns an error. Thanks. -Randy- |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No this did not work. It does not like the
.ScaleWidth or .ScaleHeight When? After created, I adj charts options and am trying to enlarge it. -Randy- *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The suggestion may not have worked for a few reasons.
You can't change the size of a chart, but you can change the size of a chart object, which is the parent of the chart. You can use something like this: With ActiveChart.Parent .Width = 325 ' dimensions in points .Height = 250 .Top = 150 ' position in points from top left of cell A1 .Left = 125 End Width But the chart object cannot be scaled the way a shape can. If you need to use ScaleWidth instead of Width, try this: ActiveSheet.Shapes(ActiveChart.Parent.Name).ScaleW idth 1.5, _ msoFalse, msoScaleFromTopLeft or ActiveChart.Parent.Width = 1.5 * ActiveChart.Parent.Width - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services http://PeltierTech.com/Excel/Charts/ _______ Randal W. Hozeski wrote: No this did not work. It does not like the .ScaleWidth or .ScaleHeight When? After created, I adj charts options and am trying to enlarge it. -Randy- *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
THANKS! The first option worked.
As long as the chart is active. It seems that once I de-activate the chart and do something else then want to go back to it. It puts that ("Chart 88") back in. I was going to try and give it a name to use so I could go back to it.... How can I return a once active chart that was de-activated back to active? I want to remove the chart so I can regenerate it. -Randy- *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Randy -
I just answered your more recent post about naming a chart. Follow one of those techniques, and name the chart something that you will look for later for deletion ("Working Chart" or "Temp Chart", whatever). Then just use a line like this before recreating the chart: ActiveSheet.ChartObjects("Working Chart").Delete An alternative is to keep the same chart, but redefine its source data and change axis titles or whatever. This might be easier or more reliable than rebuilding the chart every time. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services http://PeltierTech.com/Excel/Charts/ _______ Randal W. Hozeski wrote: THANKS! The first option worked. As long as the chart is active. It seems that once I de-activate the chart and do something else then want to go back to it. It puts that ("Chart 88") back in. I was going to try and give it a name to use so I could go back to it.... How can I return a once active chart that was de-activated back to active? I want to remove the chart so I can regenerate it. -Randy- *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|