PC Review


Reply
Thread Tools Rate Thread

deselect any "active" charts in workbook

 
 
Raul
Guest
Posts: n/a
 
      17th Apr 2008
I have a number of worksheets with scrolling charts charts on them (one chart
per worksheeet) that are updated programmatically. The chart update routine
bombs when trying to modify a scrollbar property (.object.max) if a chart has
been selected (i.e., someone clicked on a chart).

I would like to add some code to my routine to deselect all active charts in
the workbook prior to updating the scrollbar property.

Can I deselect all active charts in a workbook? If so, how?

All help will be greatly appreciated.

Thanks in advance,
Raul

Thanks,
Raul
 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      18th Apr 2008
Loop through the worksheets, and select cell A1 on each.

For i = 1 To ActiveWorkbook.Worksheets.Count
With ActiveWorkbook.Worksheets(i)
.Activate
.Range("A1").Select
End With
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Raul" <(E-Mail Removed)> wrote in message
news63C7814-AA5A-41F3-9625-(E-Mail Removed)...
>I have a number of worksheets with scrolling charts charts on them (one
>chart
> per worksheeet) that are updated programmatically. The chart update
> routine
> bombs when trying to modify a scrollbar property (.object.max) if a chart
> has
> been selected (i.e., someone clicked on a chart).
>
> I would like to add some code to my routine to deselect all active charts
> in
> the workbook prior to updating the scrollbar property.
>
> Can I deselect all active charts in a workbook? If so, how?
>
> All help will be greatly appreciated.
>
> Thanks in advance,
> Raul
>
> Thanks,
> Raul



 
Reply With Quote
 
Raul
Guest
Posts: n/a
 
      18th Apr 2008
Your solution worked like a charm.

I added an If statement to only activate worksheets with names that contain
a desired string.

For i = 1 To ActiveWorkbook.Worksheets.Count
If InStr(1, ActiveWorkbook.Worksheets(i).Name, "Scrlng", 1) <> 0 Then
With ActiveWorkbook.Worksheets(i)
.Activate
.Range("A1").Select
End With
End If
Next

Thanks,
Raul

By the way, are there any advantages or disadvantages to using a for each
loop?

"Jon Peltier" wrote:

> Loop through the worksheets, and select cell A1 on each.
>
> For i = 1 To ActiveWorkbook.Worksheets.Count
> With ActiveWorkbook.Worksheets(i)
> .Activate
> .Range("A1").Select
> End With
> Next
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> Peltier Technical Services, Inc. - http://PeltierTech.com
> _______
>
>
> "Raul" <(E-Mail Removed)> wrote in message
> news63C7814-AA5A-41F3-9625-(E-Mail Removed)...
> >I have a number of worksheets with scrolling charts charts on them (one
> >chart
> > per worksheeet) that are updated programmatically. The chart update
> > routine
> > bombs when trying to modify a scrollbar property (.object.max) if a chart
> > has
> > been selected (i.e., someone clicked on a chart).
> >
> > I would like to add some code to my routine to deselect all active charts
> > in
> > the workbook prior to updating the scrollbar property.
> >
> > Can I deselect all active charts in a workbook? If so, how?
> >
> > All help will be greatly appreciated.
> >
> > Thanks in advance,
> > Raul
> >
> > Thanks,
> > Raul

>
>
>

 
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
HELP!!! "find now" is changing my view from "day/week/month" to"Active Appointments" johng34 Microsoft Outlook Calendar 1 12th Jun 2009 03:31 AM
can't deselect "Hide Protected operating sysytem file" tmatsumoto813@gmail.com Windows XP Embedded 6 6th Jun 2007 07:36 PM
Can I keep "Windows of active workbook check box" checked =?Utf-8?B?U3VlSA==?= Microsoft Excel Misc 1 15th Feb 2007 07:38 PM
Make it easier to deselect "Show In Groups" for new folders =?Utf-8?B?bWFzdGVydHlwZQ==?= Microsoft Outlook Discussion 1 28th Sep 2005 08:03 AM
Manual "Windows Update" produces "ActiveX/active scripting" error message even with "LOW" security level setting in "Trusted" Zone Ray2 Windows XP Help 1 14th Nov 2003 06:50 PM


Features
 

Advertising
 

Newsgroups
 


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