Estimados buenas, me sale este error cuando ejecuto una macro.

Mensaje de error: cuando ejecuto commandbutton1 se ha producido un error '1004' en tiempo de ejecucion, no se puede obtener propiedad pivottables de clase worksheets.

Por favor di alguien puede apoyarme.

Set PCache = ActiveWorkbook.PivotCaches.Create( _
SourceType:=xlDatabase, SourceData:="TMRP")
Set TDinamica = PCache.CreatePivotTable( _
TableDestination:="MRPP!R1C1", TableName:="XXX")

With TDinamica.PivotFields("FECHA1")
.Orientation = xlRowField
.Position = 1
End With
With TDinamica.PivotFields("SAP5")
.Orientation = xlRowField
.Position = 2
End With
With TDinamica.PivotFields("DESCRIPCIÓN5")
.Orientation = xlRowField
.Position = 3
End With
ActiveSheet. PivotTables("XXX"). AddDataField ActiveSheet. _
PivotTables("XXX"). PivotFields("CANT5"), "Suma de CANT5", xlSum
ActiveSheet. PivotTables("XXX"). RepeatAllLabels xlRepeatLabels
ActiveSheet. PivotTables("XXX"). RowAxisLayout xlTabularRow
ActiveSheet. PivotTables("XXX"). PivotFields("FECHA1"). _
Subtotals = Array(False, False, False, False, False, False, False, False, False, False, _
False, False)
ActiveSheet. PivotTables("XXX"). PivotFields("SAP5"). _
Subtotals = Array(False, False, False, False, False, False, False, False, False, False, _
False, False)
ActiveSheet.PivotTables("XXX").ColumnGrand = False

1 respuesta

Respuesta
1

El error donde se presenta esta en negrita.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas