Turn your Mobile Apps into m-commerce apps – Learn More!

You're Browsing As A Guest! Register Now...
Become a VB.NET Expert!

Join 414,938 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,680 people online right now.Registration is fast and FREE... Join Now!



Page 1 of 1
  • You cannot start a new topic
  • Reply Reply

[VB2005]Make a scrolling chart in excel using VB.net Rate Topic: -----

#1 bellaelysium  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 2
  • View blog
  • Posts: 32
  • Joined: 08-June 08


Dream Kudos: 0

Share |

[VB2005]Make a scrolling chart in excel using VB.net

Post icon  Posted 21 July 2008 - 12:43 AM

Does anyone know how to add scrollbar on top of chart in excel to allow scrolling of chart?

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

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1
  • You cannot start a new topic
  • Reply Reply


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users