Hi,
can you please help me with replacing the worksheet data below to point to the current workbook and worksheet?
It won't only be me running the code.
Many thanks in advance
can you please help me with replacing the worksheet data below to point to the current workbook and worksheet?
It won't only be me running the code.
Code:
Workbooks("Test.xlsm").Connections.Add2 _
"WorksheetConnection_Test.xlsm!Table1", "", _
"WORKSHEET;C:\Users\xx\xxxx\Excel1\Test.xlsm" _
, "Test.xlsm!Table1", 7, True, False
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlExternal, SourceData:= _
ActiveWorkbook.Connections( _
"WorksheetConnection_Test.xlsm!Table1"), Version _
:=6).CreatePivotTable TableDestination:="Sheet5!R3C1", TableName:= _
"PivotTable2", DefaultVersion:=6
Many thanks in advance