Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
chart objects top
Hi,
I have the following code to move a chart to the top of the visible window which works fine in 2003, however with the same workbook when opened in 2010 i get a runtime error on the line: ChartObjects(1).Top = Rows(ActiveWindow.ScrollRow).Top Error is -2147024809 (80070057) The specified value is out of range. Any help in solving this would be greatly appreciated, thanks in advance Neil Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim ch 'Exit Sub If Not Intersect(Target, Range("a2:A74")) Is Nothing Then ChartObjects(1).Top = Rows(ActiveWindow.ScrollRow).Top For Each ch In ActiveSheet.ChartObjects If ch.Name = "Chart 15" Then ch.Visible = True Updatechart End If Next Else For Each ch In ActiveSheet.ChartObjects If ch.Name = "Chart 15" Then ch.Visible = False Next End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
chart objects top
I had the worksheet protected, works as soon as I took off the protection.
Still don't understand why it worked in 2003 with the protection on. Neil "Neil" wrote in message nd.com... Hi, I have the following code to move a chart to the top of the visible window which works fine in 2003, however with the same workbook when opened in 2010 i get a runtime error on the line: ChartObjects(1).Top = Rows(ActiveWindow.ScrollRow).Top Error is -2147024809 (80070057) The specified value is out of range. Any help in solving this would be greatly appreciated, thanks in advance Neil Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim ch 'Exit Sub If Not Intersect(Target, Range("a2:A74")) Is Nothing Then ChartObjects(1).Top = Rows(ActiveWindow.ScrollRow).Top For Each ch In ActiveSheet.ChartObjects If ch.Name = "Chart 15" Then ch.Visible = True Updatechart End If Next Else For Each ch In ActiveSheet.ChartObjects If ch.Name = "Chart 15" Then ch.Visible = False Next End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Name Chart Objects | Excel Discussion (Misc queries) | |||
Chart Objects | Excel Programming | |||
help with chart objects | Excel Programming | |||
Chart objects | Excel Programming | |||
Moving Chart Objects | Excel Programming |