PC Review


Reply
Thread Tools Rate Thread

2003 vba to hide two grouped charts, works in 2007 but not in 2003

 
 
Harold Good
Guest
Posts: n/a
 
      17th Dec 2009
> Hi,
Sorry I've copied this over from my post in the Charting newsgroup since
there's not much activity there.
> I have the following code which works fine in 2007. But since I have
> some users that still use 2003, when I save the spreadsheet in 2003
> xls format, this code will no longer work. I found that when I ungroup
> the two charts, then it works fine.
>
> Do I need to use code to Ungroup them first, or is there a simple
> solution?
>
> Thanks,
> Harold
>
> Sub Hide_Two_Charts()
> Sheets("Budget").ChartObjects("Chart 130").Visible = False
> Sheets("Budget").ChartObjects("Chart 190").Visible = False
> End Sub

 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      17th Dec 2009
Your code as written should work fine in Excel 2003. But it's not clear what
you have to begin with, which might be why you didn't get an answer in the
charting group.

Speculating, do you have two chartobjects which are grouped. If so is it
just a group of the two chartobjects. If so, simply -
Activesheet.Shapes("myChartGroup").Visible = false

If you have something different, eg several items in the group but you only
want to hide two, try and explain what you have and want to do.

Regards,
Peter T

"Harold Good" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> Hi,

> Sorry I've copied this over from my post in the Charting newsgroup since
> there's not much activity there.
>> I have the following code which works fine in 2007. But since I have some
>> users that still use 2003, when I save the spreadsheet in 2003 xls
>> format, this code will no longer work. I found that when I ungroup the
>> two charts, then it works fine.
>>
>> Do I need to use code to Ungroup them first, or is there a simple
>> solution?
>>
>> Thanks,
>> Harold
>>
>> Sub Hide_Two_Charts()
>> Sheets("Budget").ChartObjects("Chart 130").Visible = False
>> Sheets("Budget").ChartObjects("Chart 190").Visible = False
>> End Sub



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      17th Dec 2009
"Harold Good" <(E-Mail Removed)> wrote in message
>> Hi,

> Sorry I've copied this over from my post in the Charting newsgroup since
> there's not much activity there.


But I see you posted here barely an hour after posting in the charting
group, that's a bit quick to conclude you wouldn't have got an answer there!

Regards,
Peter T


 
Reply With Quote
 
Harold Good
Guest
Posts: n/a
 
      18th Dec 2009
Perfect! Thanks Peter, this worked perfectly. Hid both of the grouped
charts.
Harold


Peter T wrote:
> Your code as written should work fine in Excel 2003. But it's not clear what
> you have to begin with, which might be why you didn't get an answer in the
> charting group.
>
> Speculating, do you have two chartobjects which are grouped. If so is it
> just a group of the two chartobjects. If so, simply -
> Activesheet.Shapes("myChartGroup").Visible = false
>
> If you have something different, eg several items in the group but you only
> want to hide two, try and explain what you have and want to do.
>
> Regards,
> Peter T
>
> "Harold Good" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>> Hi,
>>>

>> Sorry I've copied this over from my post in the Charting newsgroup since
>> there's not much activity there.
>>
>>> I have the following code which works fine in 2007. But since I have some
>>> users that still use 2003, when I save the spreadsheet in 2003 xls
>>> format, this code will no longer work. I found that when I ungroup the
>>> two charts, then it works fine.
>>>
>>> Do I need to use code to Ungroup them first, or is there a simple
>>> solution?
>>>
>>> Thanks,
>>> Harold
>>>
>>> Sub Hide_Two_Charts()
>>> Sheets("Budget").ChartObjects("Chart 130").Visible = False
>>> Sheets("Budget").ChartObjects("Chart 190").Visible = False
>>> End Sub
>>>

>
>
>

 
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
vba to hide two grouped charts in 2003 - doesn't work Harold Good Microsoft Excel Charting 0 17th Dec 2009 09:03 PM
Charts: 2007 to 2003 PolarLight Microsoft Excel Discussion 0 2nd Dec 2008 09:35 PM
Charts 2007 v 2003 Martin Conradi Microsoft Powerpoint 5 3rd Oct 2007 05:11 PM
Hide Row macro works in 2002 but not 2003 =?Utf-8?B?R29vc2VyNTU1?= Microsoft Excel Programming 3 16th Feb 2005 10:17 PM
How to hide columns in grouped worksheets that works in a macro =?Utf-8?B?SG9vZA==?= Microsoft Excel Worksheet Functions 0 21st Sep 2004 08:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 PM.