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: 2
Default Create a dynamic chart with code

Hello,

I am trying to create a dynamic chart using code in a diferent workbook
from the code one and itīs imposible for me. I can create one dynamic
chart in the same workbook of the code but when I try this code to
create the grph in a different workbook the problems appears.

Thank you in advance.
The data is coloumn "C".
The code that generate error is the one with

___The code is this one ____

Sub Grafico()
'

ActiveWorkbook.Names.Add Name:="RngC", RefersToR1C1:= _
"=OFFSET(Hoja1!R2C3,0,0,COUNTA(Hoja1!C3)-1)"


Sheets(1).Name = "TOC"

Windows("TOC").Activate

Charts.Add
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SetSourceData Source:=Sheets("TOC").Range("C2:C3065"),
PlotBy:= _
xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="TOC"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "TOC en "
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "ppb"
End With
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = False
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowNone,
LegendKey:=False
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Interior
.ColorIndex = 2
.PatternColorIndex = 1
.Pattern = xlSolid
End With
End Sub

 
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 you create a dynamic chart in an xlt templet mark1035 Charts and Charting in Excel 1 April 15th 09 12:23 AM
how to create a chart from a dynamic table of data? linda Charts and Charting in Excel 13 September 12th 07 05:06 AM
Why doesn't the code create a column stacked chart? tskogstrom Charts and Charting in Excel 3 October 26th 06 05:27 PM
TIP: Dynamic chart selection without code Dermot Charts and Charting in Excel 0 August 11th 06 08:23 AM
How do I create a dynamic chart Nick Krill Charts and Charting in Excel 5 January 21st 06 08:25 PM


All times are GMT +1. The time now is 06:17 AM.

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"