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: 1
Default Problem with using a macro to create a chart

Hi,

I am struggling with how to create a new graph in my spreadsheet and
place it as an object in an existing sheet. The code i have (mainly
salvaged from using the record function) fails on the highlighted line
below. Even replaying the recorded macros dont help as they still fail
at this line.

Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Worksheets(1).Range("A1")
ActiveChart.Location Whe=xlLocationAsObject, _
Name:="GIFcontainer"

It seems that as soon as the first line is executed a new sheet is
automatically created containing the new graph hence messing up the
last line.


Does anyone know whats going on?

Many Thanks,
Tom


---
Message posted from http://www.ExcelForum.com/

 
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
Create a Chart using a Macro Scott_goddard Charts and Charting in Excel 1 April 8th 10 10:26 AM
Macro to create a new chart kimbobo Charts and Charting in Excel 1 August 18th 06 02:44 PM
VB Macro to Create a Chart [email protected] Excel Discussion (Misc queries) 0 August 15th 06 10:25 PM
Setting up Macro to create pie chart. Hamish Charts and Charting in Excel 2 August 8th 06 02:30 PM
Macro to Create a Chart and Update it Automatically maperalia Charts and Charting in Excel 2 October 21st 05 05:42 PM


All times are GMT +1. The time now is 11:16 PM.

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"