Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
can someone tell me how to deselect "select all" in Excel? | Excel Worksheet Functions | |||
Can I keep "Windows of active workbook check box" checked | Excel Discussion (Misc queries) | |||
Is Active Workbook ="ABC" | Excel Programming | |||
"deselect ?" a range or change state from edit to ? | Excel Programming | |||
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc | Excel Programming |