LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default for each chart (sheet and embedded)

I'd like to change a chart setting for every chart (both chart sheets
and charts embedded in worksheets) in a workbook. I modified the below
code from Tom Ogilvy (thanks!), but I get an error when I try to modify
the chart settings with "cht.PlotVisibleOnly = False". If I change
"cht" to type Chart instead of type Object, the line would work, but
then I get a type mismatch error at "For Each cht In sh.ChartObjects".
Any ideas? Thanks!

Sub tester1()
Dim cht As Object, sh as Worksheet
For Each sh In ThisWorkbook.Worksheets
If sh.ChartObjects.Count 0 Then
sh.Activate
For Each cht In sh.ChartObjects
cht.Select
cht.PlotVisibleOnly = False
Next
End If
Next
For Each cht In ThisWorkbook.Charts
cht.Activate
cht.PlotVisibleOnly = False
Next
End Sub

 
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
Embedded Chart Versus Chart - ShowDetail Issue [email protected] Charts and Charting in Excel 1 May 14th 06 04:11 PM
what is the difference between embedded chart and chart-in-a-sheet dhruv Excel Programming 1 January 18th 06 03:35 PM
How to make chart embedded in active sheet? RB Smissaert Excel Programming 5 September 9th 05 07:41 AM
Embedded Chart in Excel Sheet George Charts and Charting in Excel 3 August 4th 05 12:19 PM
How to find a Chart embedded in a Sheet? Gilroy Excel Programming 1 June 27th 04 03:29 AM


All times are GMT +1. The time now is 06:44 AM.

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

About Us

"It's about Microsoft Excel"