Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default deselect any "active" charts in workbook

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default deselect any "active" charts in workbook

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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default deselect any "active" charts in workbook

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
can someone tell me how to deselect "select all" in Excel? scott Excel Worksheet Functions 3 February 17th 10 07:35 PM
Can I keep "Windows of active workbook check box" checked SueH Excel Discussion (Misc queries) 1 February 15th 07 07:38 PM
Is Active Workbook ="ABC" Otto Moehrbach[_6_] Excel Programming 5 August 20th 04 06:30 PM
"deselect ?" a range or change state from edit to ? mark kubicki Excel Programming 0 August 11th 04 07:34 PM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM


All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"