Double Clicking on Pivot tables GrandTotal data creates a separate sheet with entire data source. Would like to get this done through powershell. Below is the code I tried with Powershell 5.1.
$excelFile = "C:estTestfile.xlsb"
$Excel = New-Object -ComObject Excel.Application
$wb = $Excel.Workbooks.Open($excelFile)
$s=$wb.worksheets(1).range("C7").select
$s.showdetail
$wb.saveas("C:estTestfile_modified.xlsb")
$wb.close()
$Excel.quit()
question from:https://stackoverflow.com/questions/66049485/create-a-new-sheet-using-showdetail-on-pivottabes-field-in-powershell-vba