PC Review


Reply
Thread Tools Rate Thread

chart objects top

 
 
Neil
Guest
Posts: n/a
 
      21st Sep 2010
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 With Quote
 
 
 
 
Neil
Guest
Posts: n/a
 
      22nd Sep 2010
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" <(E-Mail Removed)> wrote in message
news:U_Wlo.6921$(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart objects from C# Mogur Microsoft Powerpoint 3 23rd Dec 2009 04:55 PM
Chart Objects Nick 'The Database Guy' Microsoft Access Reports 2 13th Aug 2008 01:07 PM
How to Name Chart Objects DCSwearingen Microsoft Excel Misc 2 30th Jul 2006 10:27 AM
Chart objects Erich Neuwirth Microsoft Excel Programming 1 13th Aug 2004 02:11 AM
Excel97 chart objects compatible with Excel2000 chart objects Vivekananda Microsoft Excel Charting 1 27th Feb 2004 06:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:37 PM.