Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default ChartingQuestion

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default ChartingQuestion

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default ChartingQuestion

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default ChartingQuestion

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default ChartingQuestion

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default ChartingQuestion

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
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



All times are GMT +1. The time now is 02:59 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"