hola grupo... este es un codigo que copie del foro para graficas en
formulario con office-web-components pero al ejecutarlo me sale error en la
linea
.Cells(Fila - 6, Col - 1) = Dato
argumento no valido
el codigo completo es :
Sub Actualiza()
Dim Fila As Byte, _
Col As Byte, _
Dato As Variant, _
Cc As Object
With Spreadsheet1
.Cells(1, 1) = "Fecha"
.Cells(1, 2) = "Uno"
.Cells(1, 3) = "Dos"
For Col = 2 To 4
For Fila = 8 To 25
Dato = Worksheets("Informe").Cells(Fila, Col)
.Cells(Fila - 6, Col - 1) = Dato
If Col = 2 Then
.Cells(Fila - 6, Col - 1).NumberFormat = "d-mmm-yy"
Else
.Cells(Fila - 6, Col - 1).NumberFormat = "0.00"
End If
Next
Next
End With
With ChartSpace1
.Clear
Set Cc = .Constants
Set .DataSource = Me.Spreadsheet1
.Charts.Add
With .Charts(0)
' tipo de gráfico
.Type = Cc.chChartTypeLine
' añado los nombres de las series
.SetData Cc.chDimSeriesNames, 0, "b1:c1"
' añado las distintas series
.SeriesCollection(0).SetData Cc.chDimValues, 0, "b2:b17"
.SeriesCollection.Add
.SeriesCollection(1).SetData Cc.chDimSeriesNames, 0, "c1"
.SeriesCollection(1).SetData Cc.chDimValues, 0, "c2:c17"
' rango del eje X
.SetData Cc.chDimCategories, 0, "a2:a17"
End With
End With
End Sub
Leer las respuestas