I have successfully add in scrollbar manually and it was able to scroll the chart in new chart sheet and I recorded the VBA code.
PS: I am using 'Forms' scrollbar control.
However, there's these few lines which I have problems converting:
ActiveSheet.ScrollBars.Add(1428928.5, 224788.5, 3806190, 223698).Select Selection.ShapeRange.IncrementLeft -0.02 Selection.ShapeRange.IncrementTop 5.31 Selection.ShapeRange.ScaleWidth 1.27, msoFalse, msoScaleFromBottomRight Selection.ShapeRange.ScaleWidth 1.03, msoFalse, msoScaleFromTopLeft With Selection .Value = 0 .Min = 0 .Max = 23 .SmallChange = 1 .LargeChange = 10 .LinkedCell = "AnimalRackTrial!$K$31" .Display3DShading = True End With
Whats the code for form scrollbar?
ActiveSheet.ScrollBars.Add(1428928.5, 224788.5, 3806190, 223698).Select
and I got problem converting this line:
Selection.ShapeRange.IncrementLeft -0.02 Selection.ShapeRange.IncrementTop 5.31 Selection.ShapeRange.ScaleWidth 1.27, msoFalse, msoScaleFromBottomRight Selection.ShapeRange.ScaleWidth 1.03, msoFalse, msoScaleFromTopLeft
I have to make sure that the scrollbar always stay on top of the chart and the same width as the graph.
And for these:
With Selection .Value = 0 .Min = 0 .Max = 23 .SmallChange = 1 .LargeChange = 10 .LinkedCell = "AnimalRackTrial!$K$31" .Display3DShading = True End With
I tried :
objExcelC.ScrollBars.Add(1428928.5, 224788.5, 3806190, 223698) With objExcelC.ScrollBars.Add(1428928.5, 224788.5, 3806190, 223698) .Value = 0 .Min = 0 .Max = 23 .SmallChange = 1 .LargeChange = 10 .LinkedCell = "AnimalRackTrial!$K$31" .Display3DShading = True End With
but there's no scrollbar added in, even if there's no error.
I also tried inserting OLEobject
Dim MyObject As OLEObject MyObject = objExcelC.OLEObjects.Add(ClassType:="Forms.ScrollBar.1") With MyObject .Value = 0 .Min = 0 .Max = 23 .SmallChange = 1 .LargeChange = 10 .LinkedCell = "AnimalRackTrial!$K$31" .Display3DShading = True End With
But theres some error.
Help appreciated or if there's any tutorial link...I will be willing to look into it.
This post has been edited by bellaelysium: 21 July 2008 - 12:53 AM


Reply





MultiQuote






|