This Code works VB but gives exception in VB.NET, Why?
问题 Aim to achieve : I want to change the SourceData of the Pivot table. I want to change it from 'C:\[file.xlsx]SheetName'!RangeName to 'SheetName'!RangeName I have the following implementation : For Each table In sheet.PivotTables Dim str = "'" + Split(table.SourceData, "]")(1) table.SourceData = str // Gives Exception here Next table // Exception: Exception from HRESULT: 0x800A03EC At the time of error str has value 'SheetName'!RangeName (This is fine.. ) I am also getting a message box before