A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can not get Excel macros to format/save charts--help??? :(((((



 
 
Thread Tools Display Modes
  #1  
Old March 18th, 2010, 10:04 PM posted to microsoft.public.excel.charting
AccessQuestion
external usenet poster
 
Posts: 10
Default Can not get Excel macros to format/save charts--help??? :(((((

Help??(( I've spent the last 5 days searching on this forum for problems
similar to what I have but no luck! I am trying to use Excel macro to create
a simple bar chart and to format the chart type/etc...but the macro keeps
erroring when I try to run it.
The debug points to "
'
Set ActiveChart = ActiveSheet.ChartObjects(Chart1)" run time error 1004.
No matter what I name the chart, it errors.
I'm advanced at Excel but not editing macros with VB.
I'm at my wits end and hope that someone can help me (



  #2  
Old March 19th, 2010, 09:30 AM posted to microsoft.public.excel.charting
Andy Pope
external usenet poster
 
Posts: 2,088
Default Can not get Excel macros to format/save charts--help??? :(((((

Hi,

You do not set the Activechart object in that way. It is automatically
assigned by activating the chart.

Activesheet.chartobjects("Chart 1").activate

Now you can use the Activechart object, for example.

Msgbox "Chart has " & Activechart.seriescollection.count & " series"

Cheers
Andy

On 18/03/2010 21:04, AccessQuestion wrote:
Help??(( I've spent the last 5 days searching on this forum for problems
similar to what I have but no luck! I am trying to use Excel macro to create
a simple bar chart and to format the chart type/etc...but the macro keeps
erroring when I try to run it.
The debug points to "
'
Set ActiveChart = ActiveSheet.ChartObjects(Chart1)" run time error 1004.
No matter what I name the chart, it errors.
I'm advanced at Excel but not editing macros with VB.
I'm at my wits end and hope that someone can help me (




--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

  #3  
Old March 22nd, 2010, 09:13 PM posted to microsoft.public.excel.charting
AccessQuestion
external usenet poster
 
Posts: 10
Default Can not get Excel macros to format/save charts--help??? :(((((

Hi Andy,
Thanks for your answer but I'm not sure I understand.
This is my code and the debugger keeps stopping on ActiveChart.SetSourceData
line.


'
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
' ActiveChart.SetSourceData



--
mfg2529


"Andy Pope" wrote:

Hi,

You do not set the Activechart object in that way. It is automatically
assigned by activating the chart.

Activesheet.chartobjects("Chart 1").activate

Now you can use the Activechart object, for example.

Msgbox "Chart has " & Activechart.seriescollection.count & " series"

Cheers
Andy

On 18/03/2010 21:04, AccessQuestion wrote:
Help??(( I've spent the last 5 days searching on this forum for problems
similar to what I have but no luck! I am trying to use Excel macro to create
a simple bar chart and to format the chart type/etc...but the macro keeps
erroring when I try to run it.
The debug points to "
'
Set ActiveChart = ActiveSheet.ChartObjects(Chart1)" run time error 1004.
No matter what I name the chart, it errors.
I'm advanced at Excel but not editing macros with VB.
I'm at my wits end and hope that someone can help me (




--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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