Drag and drop pivot table fields in excel

Hi,
I want to create a pivot table and drag and drop fields in (Filters,Columns,Rows & Values)Sections.How can I search and drag&drop the fields in the sections??

I don’t know how can we do that using existing activities @simran87

But we can do that easily using VB code :slight_smile:

Let me know if you are willing to do that using code or try recording a macro in the excel and use Invoke VBA activity to do that… This is even better way to do that

2 Likes

Hi @HareeshMR,
I am trying to use Invoke VBA activity.
Steps which are done:

  1. recorded the macro for creating the pivot table and saved it as .txt file
    2)Added Excel Application Scope
    3)Included the Invoke VBA activity inside it and attached the .txt file
    Now, what is the path forward after this??

Don’t save it as txt. The extension has to be .vb. Whatever you are doing is perfect and just running the workflow will do the tasks whatever you have in macro. Try that @simran87

You can also save your macro in your personal macro workbook (personal.xlsb) (HOW TO)

Then simply use the “Execute Macro” activity in an Excel Application Scope and enter MacroPath like this:

"'C:\Users\" + Environment.UserName.ToLower + "\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.XLSB'!macroName.macroName"

Cheers, Lukas