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: 23
Default chart name

hi all
I placed a chart through vba on a worksheet, but when I try to address to
the chart always get the same error (to rename the chart): Run-time error
'1004': Method 'Name' of object '_Chart' failed. Here is the code I'm using:
Sub AddEmbeddedChart()
Dim Chrt As Chart
ActiveSheet.ChartObjects.Delete
Set Chrt = Charts.Add
Set Chrt = Chrt.Location(whe=xlLocationAsObject, Name:="main")
With Chrt
.ChartType = xlColumnClustered
.ChartArea.Font.Name = "Tahoma"
.ChartArea.Font.FontStyle = "Regular"
.ChartArea.Font.Size = 8
.SetSourceData Source:=Sheets("data_assets").Range("b7:c24"),
PlotBy:=xlRows
.HasTitle = True
.HasLegend = False
.ChartTitle.Text = "Testing"
With .Parent
.Top = Range("F9").Top
.Left = Range("F1").Left
.Name = "GSCProductChart"
End With
End With
ActiveChart.Name = "test"
MsgBox "Chart name is " & ActiveChart.Name
Worksheets("main").Cells(1, 1).Select
End Sub
What am I doing wrong?
thanks a lot.
 
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
how to remove dotted line with words chart area from around chart desof Charts and Charting in Excel 2 May 13th 09 10:18 PM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Charts and Charting in Excel 2 March 6th 09 04:43 PM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Setting up and Configuration of Excel 1 March 6th 09 01:57 AM
Cannot Activate Chart Area in Chart. Chart Object Failed [email protected] Excel Programming 2 August 8th 06 02:38 AM
vc++ automation: opening chart as chart window and setting scale Mike Biolsi Excel Programming 0 February 7th 04 08:13 AM


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