Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can you create a dynamic chart in an xlt templet | Charts and Charting in Excel | |||
how to create a chart from a dynamic table of data? | Charts and Charting in Excel | |||
Why doesn't the code create a column stacked chart? | Charts and Charting in Excel | |||
TIP: Dynamic chart selection without code | Charts and Charting in Excel | |||
How do I create a dynamic chart | Charts and Charting in Excel |