Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / November 2003

Tip: Looking for answers? Try searching our database.

Furtive Bug!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Hageman - 05 Nov 2003 12:20 GMT
On different worksheets are (Forms) Buttons with the below
macros assigned to them.  "GoToUtilizationChart()" works
perfectly, but "GoToPPVChart()" only brings up
the "Metrics" worksheet and cursors to A1 - it does not
select the chart.  Chart names are confirmed correct.  To
test the problem, I copy/pasted the "Utilization" macro
and substituted "PPV" and "3" in the code - still doesn't
select the PPV chart.  Can someone help me exterminate
this bug?!

Appreciate any help...
Phil

Sub GoToPPVChart()
   Sheets("Metrics").Select
   Range("A1").Select
   With ActiveSheet.ChartObjects("Chart 13")
       .Height = 660
       .Width = 780
       .Top = 10
       .Left = 125
   End With
End Sub

Sub GoToUtilizationChart()
   Sheets("Metrics").Select
   Range("A1").Select
   With ActiveSheet.ChartObjects("Chart 17")
       .Height = 660
       .Width = 780
       .Top = 10
       .Left = 125
   End With
End Sub
Tushar Mehta - 05 Nov 2003 15:06 GMT
Nothing in the code attempts to select any chart.  So, I'm at a loss as
to why you expect a chart to be selected.

Is the chart the correct size and at the correct location after the
macro finishes?

Do you have any error handling enabled?  If so, disable it.

Signature

Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

> On different worksheets are (Forms) Buttons with the below
> macros assigned to them.  "GoToUtilizationChart()" works
[quoted text clipped - 30 lines]
>     End With
> End Sub
Phil Hageman - 05 Nov 2003 15:45 GMT
Tushar,  Thanks for your replay.
Maybe "select" is the wrong term.  When the button is
clicked, the "Metrics" worksheet should comes on screen,
the cursor should go to A1, and the chart called for in
the macro should become current, sized, and move to the
Top/Left position.  In this problem, the "Utilization"
chart is performing exactly this way; but the "PPV" chart
doesn't resize or position.  Is there another way to get
the desired result?  No error handling is enabled.
>-----Original Message-----
>Nothing in the code attempts to select any chart.  So, I'm at a loss as
[quoted text clipped - 41 lines]
>>
>.
Jon Peltier - 05 Nov 2003 17:33 GMT
Phil -

I just tried your procedures with two charts (13 & 17), without changing
a bit of the code.  Both worked fine, as I expected, with the sheet
unprotected and protected.  How did you verify the chart names?  Run
this short program:

Sub ListCharts()
Dim msg As String
Dim chtob As ChartObject
msg = ActiveSheet.Name & vbCrLf
For Each chtob In ActiveSheet.ChartObjects
    msg = msg & vbCrLf & chtob.Name
Next
MsgBox msg
End Sub

It should give you this (and more if there are more charts):

Metrics

Chart 13
Chart 17

What do you get?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

> Tushar,  Thanks for your replay.
> Maybe "select" is the wrong term.  When the button is
[quoted text clipped - 71 lines]
>>
>>.
Phil Hageman - 05 Nov 2003 19:31 GMT
Jon, the message box came up with:
 Chart 13
 Chart 17
 Chart 33
 Chart 36
Tell you what, let me play with this some more and get
back to you.  I have two versions of this code which work
(both on my threads in this NG).  This problem seems
intermittant and must be coming from another area of the
workbook.  I will post tomorrow if I run into trouble...

Thanks for all your help.  Phil
>-----Original Message-----
>Phil -
[quoted text clipped - 106 lines]
>
>.
Jon Peltier - 06 Nov 2003 01:37 GMT
Phil -

Okay, now we're down to basics.  Restart Excel, and see if it works.
Copy the charts to another sheet, and see if it works.  Rebuild the
charts in a new workbook, and see if it works.  Trade in your balky old
monster for a sleek new laptop, and see if it works.  That last step
might be a bit extreme, but I am beginning to suspect that your workbook
is becoming corrupt.

Another thing: it's possible to put additional layers of protection on a
chart.  Some of these would interfere with the code.  But you need VBA
to do it, so you'd probably remember that you'd done such a thing.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

> Jon, the message box came up with:
>   Chart 13
[quoted text clipped - 147 lines]
>>>
>>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.