question about scrollbars and embedded charts

B

Brian Murphy

Hello Excel Newsgroup,

I've been trying to place some scrollbars inside an embedded chart on a
worksheet. I can't seem to do this with the scrollbar from the Control
Toolbox toolbar, but I can from the Forms toolbar.

Based on previous experiences with the performance of scrollbars, I think
the Control Toolbox version is the one that I ought to be using. Is there
some reason why they cannot be placed inside an embedded graph, or on a
graph sheet for that matter?

Thanks,

Brian Murphy
Austin, Texas
 
B

Brian Murphy

Well, I suppose you are confirming that Control Toolbox scrollbars can not be put inside a chart.

I was hoping it was because there was something I was doing wrong. Please correct me if this is not right.

Thanks,

Brian
 
D

Dave Peterson

I don't think you are doing anything wrong (well, in excel anyway!).

I think your conclusion is accurate.
 
B

Brian Murphy

Thanks, Dave. I will pursue the Forms version.

Here's something strange.

I'm finding that to programmatically change the properties of a Forms
scrollbar, I have to "Select" it first, and then use Selection.whatever.
All other ways I've tried give a r/t error.

Brian
 
D

Dave Peterson

You can get it by going through the chart:

Option Explicit
Sub testme()

Dim mySB As ScrollBar

With Worksheets("sheet1").ChartObjects(1)
Set mySB = .Chart.ScrollBars("scroll bar 1")
With mySB
.LargeChange = 10
.SmallChange = 1
.Min = 8
.Max = 100
.LinkedCell = Worksheets("sheet1").Range("a1") _
.Address(external:=True)
End With
End With

End Sub

If you know your chart is active:

With ActiveChart
Set mySB = .ScrollBars("scroll bar 1")
 
B

Brian Murphy

Thanks again, Dave.

I think I was trying to do it like:

With Activechart.Chart.ScrollBars("scroll bar 1")

I don't think I tried a Set statement.
I will give it a try, since I don't really want to Select the thing.

Brian
 
D

Dave Peterson

You could have used:

With Worksheets("sheet1").ChartObjects(1).Chart.ScrollBars("scroll bar 1")

instead of:

With Worksheets("sheet1").ChartObjects(1)
Set mySB = .Chart.ScrollBars("scroll bar 1")
With mySB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top