Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
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   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
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   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
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

.

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 not get Excel macros to save chart format -lost in space! AccessQuestion Charts and Charting in Excel 5 March 19th 10 02:38 PM
Imported Visual Basic Module - Save Macros for use in Excel Pat Adams Excel Discussion (Misc queries) 1 December 2nd 09 09:44 PM
How to save & send Excel files without macros. CC Excel Discussion (Misc queries) 6 October 13th 08 11:52 PM
Remove all macros and objects in Excel, Save and Quit [email protected] Excel Discussion (Misc queries) 0 June 2nd 06 12:24 PM
Excel Charts(Graphs) & Macros John Excel Discussion (Misc queries) 4 July 7th 05 09:26 PM


All times are GMT +1. The time now is 04: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"