Hi
Hit the send button too soon
I meant to add, you could ensure this didn't happen if you specifically
selected the source data sheet before starting
Sheets("Projects Detail & GL Accounts").Range("A1").Select
Dim endRow As Long
endRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("K2").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"'Projects Detail & GL Accounts'!R1C1:R" & (endRow + 1) &
"C16").CreatePivotTable _
TableDestination:="", TableName:="PivotTable1", DefaultVersion:= _
xlPivotTableVersion10
--
Regards
Roger Govier
"COV MarshallT" <(E-Mail Removed)> wrote in message
news:4365B981-B837-4133-939F-(E-Mail Removed)...
>I have recorded a macro to create a PivotTable, and I can get it to run
> successfully on my PC. But when a user on another PC tries it, they get
> "Run-time error '1004': Application-defined or object-defined error. When
> I
> go to debug, the entire portion of the below code beginning with
> "ActiveWorkbook" is highlighted as the source of the problem. Does anyone
> have any idea as to why this might happen? Thanks for your help!
> Range("A1").Select
> Dim endRow As Long
> endRow = Cells(Rows.Count, 1).End(xlUp).Row
> Range("K2").Select
> ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
> "'Projects Detail & GL Accounts'!R1C1:R" & (endRow + 1) &
> "C16").CreatePivotTable _
> TableDestination:="", TableName:="PivotTable1", DefaultVersion:= _
> xlPivotTableVersion10
|