How to read pivot table from excel sheet in DataTable form

I have created a pivot table , now i want to share it in email body.

Hi @ankush.jeengar

Go through this

Hope it helps!!

I have pivot table in Excel. I want to send that table in email body.

Hi @ankush.jeengar
Check on this thread

Regards,

@lrtetala Bot is unable to read pivot table using read range activity.
I need to read that pivot table from Excel.

Hi @ankush.jeengar

Please refer this thread

Hope it helps.

Regards,

@ankush.jeengar
Try this

Sub GetPivotSourceData()
    Dim PT As PivotTable
    Set PT = ActiveSheet.PivotTables(1)
    PT.TableRange1.Cells(pT.TableRange1.Rows.Count, pT.TableRange1.Columns.Count).Select
    Selection.ShowDetail = True
    ActiveSheet.Name = "READ THIS SHEET"
End Sub

(Use the above in a Invoke VBA activity)

The above expands the data in the pivot table saves it to a new sheet called “READ THIS SHEET” you can then use a read range for this created sheet.

If you want to do this more than once within the same excel file you will get an error. This is because there will be more than 1 sheet named “READ THIS SHEET”.

To Avoid this, you can use the following code after you have finished with reading the sheet,

Sub DeleteSheet()
    ActiveSheet.Delete
End Sub

(Use the above in a Invoke VBA activity)

This just deletes the sheet.

Hopefully this will help