Creation of Pivot Table

Hey guys,
I wanna know how Pivot table can be created.
I’ve just created a pivot table manually.
And, I tried automating it with the activity, but getting errors. Test.xaml (5.6 KB)

I need some help here.

Thank you.

@NiranjanKN,

Checked with this activity?

Yea @sarathi125,
I’ve used that same activity.
Sometimes it works fine and creates a pivot table, but it’ll be in a different format and not as how I need and sometimes it’ll just throw an error.

Hi @NiranjanKN,
If the excel data is in form of excel this activity can be used for pivot table creation.
If not we can use invoke code to do so

Hi @NiranjanKN,

Kindly follow the link below,

Hey, @samir
I followed the steps:

  1. Record macro with creating Pivot table, Save that Macro in a text file with a .txt extension.
  2. call the text file in invoke VBA code Activity. (and mention that method name in activity)
    place the invoke vba activity in a Excel Application Scope Activity.
  3. If any arguments need to pass to the method, pass in the “Entry Method Parameters” (to make range dynamic)

But, I got this error.

May I know what needs to be changed in this Pivot.zip (25.3 KB)

Thank you.

Hi @NiranjanKN,

Firstly, Do check EntryMethodName (parameter of Invoke VBA activity), In your macro, the method name is Macro1, so mention the same at EntryMethodName parameter (“Macro1” instead of “Main”).

Secondly, don’t forget to check this checkbox below,

image

Steps:

  1. click on Developer
  2. Macro settings
  3. Trust access to the VBA project object model

Hi @NiranjanKN,

Were you able to resolve this error? I’m having the same problem as well.

Thanks!

@caduque
The error got resolved by using the steps provided by @samir .

Hey,

I tried pivot table creation with invoke macro VBA activity. Pivot Table.zip (10.0 KB)

Thanks