PDA

View Full Version : Solved: How to initialize scroll bar w/o active object



willin
08-14-2007, 10:26 AM
Hi there,

I hv some scroll bar in different shts(chart sheet), so I don't want the approach which active sheet then set the property.

but when I change below code (it's working well):

Sheets("Chart1").Select
ActiveChart.Shapes("Scroll Bar 1").Select
With Selection
.Max = 10
End With
Sheets("Chart1").Select

to:
Sheets("Chart1").ChartObject(1).Chart.Shapes("Scroll Bar 1").Max = 10

but it doesn't work.

How to revise it?

Your any suggestion or comments will be appreciated very much!

Tommy
08-14-2007, 05:01 PM
Sheets("Chart1").Select '<- this is a sheet
ActiveChart.Shapes("Scroll Bar 1").Select '<- this is an active chart, not the selected sheet


ActiveChart.Shapes("Scroll Bar 1").Max = 10 '<- This may work I didn't test


:yes

willin
08-14-2007, 10:59 PM
Thks for yr comments.

But I want know the macro code that change the property without select or active the sheet or object. something like that:
Sheets("Chart1").ChartObject(1).Chart.Shapes("Scroll Bar 1").Max = 10
Question is how to revise as it doesn't work.

Anybody know it?

Andy Pope
08-15-2007, 01:30 AM
Try



Sheets("Chart1").Shapes("Scroll Bar 1").ControlFormat.Max = 20

willin
08-15-2007, 04:29 AM
Try



Sheets("Chart1").Shapes("Scroll Bar 1").ControlFormat.Max = 20


Thks Andy for your great help!

I also very like yr web site chart!