Hi I am planning to make a pivot table using UIpath.
Is there a way to make a pivot using UIpath? anyone have experienced on this? what function to use?
Try this approach without any short-cuts you can achieve this using vb.net code
find the attach exampleâŚ
pivot_table.zip (10.9 KB)
note:this would run from 2017.1.6522 version of ui-path
regards
sanjay shankhla
Hai @sanjay21051990, Can you tell me once how to write the VB.net code to build the pivot table!?
Thankyou @sanjay21051990.
I got the following error, can you tell me the reason for the error.
The xaml file is attached below,
PivotTable.xaml (13.1 KB)
PivotTable has thrown an exception
Source: Invoke code
Message: Error compiling code
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Applicationâ. Are you missing an assembly reference? At line 1
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Workbookâ. Are you missing an assembly reference? At line 2
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 4
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 5
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Rangeâ. Are you missing an assembly reference? At line 6
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Rangeâ. Are you missing an assembly reference? At line 7
error BC30002: Type âMicrosoft.Office.Interop.Excel.ApplicationClassâ is not defined. At line 9
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 14
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 19
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Rangeâ. Are you missing an assembly reference? At line 21
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotCacheâ is not defined. At line 24
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotTablesâ is not defined. At line 25
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotTableâ is not defined. At line 26
error BC30456: âXlPivotTableSourceTypeâ is not a member of âExcelâ. At line 28
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotCacheâ is not defined. At line 28
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotTablesâ is not defined. At line 29
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 34
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 37
error BC30456: âXlPivotFieldOrientationâ is not a member of âExcelâ. At line 38
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 41
error BC30456: âXlPivotFieldOrientationâ is not a member of âExcelâ. At line 42
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 44
error BC30456: âXlPivotFieldOrientationâ is not a member of âExcelâ. At line 45
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 47
error BC30456: âXlPivotFieldOrientationâ is not a member of âExcelâ. At line 48
error BC30456: âXlConsolidationFunctionâ is not a member of âExcelâ. At line 49
Exception Type: ArgumentException
System.ArgumentException: Error compiling code
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Applicationâ. Are you missing an assembly reference? At line 1
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Workbookâ. Are you missing an assembly reference? At line 2
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 4
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 5
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Rangeâ. Are you missing an assembly reference? At line 6
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Rangeâ. Are you missing an assembly reference? At line 7
error BC30002: Type âMicrosoft.Office.Interop.Excel.ApplicationClassâ is not defined. At line 9
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 14
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 19
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Rangeâ. Are you missing an assembly reference? At line 21
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotCacheâ is not defined. At line 24
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotTablesâ is not defined. At line 25
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotTableâ is not defined. At line 26
error BC30456: âXlPivotTableSourceTypeâ is not a member of âExcelâ. At line 28
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotCacheâ is not defined. At line 28
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotTablesâ is not defined. At line 29
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 34
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 37
error BC30456: âXlPivotFieldOrientationâ is not a member of âExcelâ. At line 38
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 41
error BC30456: âXlPivotFieldOrientationâ is not a member of âExcelâ. At line 42
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 44
error BC30456: âXlPivotFieldOrientationâ is not a member of âExcelâ. At line 45
error BC30002: Type âMicrosoft.Office.Interop.Excel.PivotFieldâ is not defined. At line 47
error BC30456: âXlPivotFieldOrientationâ is not a member of âExcelâ. At line 48
error BC30456: âXlConsolidationFunctionâ is not a member of âExcelâ. At line 49
at UiPath.Core.Activities.Workflow.CompilerRunner.Compile(String code, Int32 errLineOffset, Boolean generateInMemory)
at UiPath.Core.Activities.Workflow.CompilerRunnerâŚctor(String code, String className, String methodName, Int32 errLineOffset, Boolean generateInMemory)
at UiPath.Core.Activities.InvokeCode.GetCompilerRunner(String userCode, List`1 args, String imps)
at UiPath.Core.Activities.InvokeCode.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Regards,
Sushmitha.
please include the namespace
called Microsoft.Office.Interop.Excel in xaml file
@sushmithaelluru click import and type Microsoft.Office.Interop.Excel follow below link image to import
Ya got it @sanjay21051990, Thanks much.
And can i know how to write the vb coding, I mean how to learn and implement the vb code!?
Hai @indra, am getting the below error attached,
But in my requirement I need to create that excel sheet with pivot table and send an email.
Hai @sanjay21051990, it is showing the child warnings for close workbook activity, even if I declare the scope of the workbook variable globally!!
I attached the xaml file, can you please check it once.
PivotTable.xaml (18.1 KB)
Regards,
Sushmitha.
Excel file is opened in the vbscript close which is opened
wb = excel.Workbooks.Open(âC:\Users\sushmi\Desktop\New Microsoft Office Excel Worksheet (2).xlsxâ)âOpen the excel the fileâ
excel.Visible=True
The above expression is one where we open the excel sheet!? @indra!?
At the end of the program use this excel.quit in vbcode
But also not able to send email @indra, even I use excel.quit, getting the error as the excel is being used by another process!
hey @sanjay21051990
I ran your sample code to create pivot table in my project.
I got the below error.
Invoke code : Error compiling code
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Applicationâ. Are you missing an assembly reference? At line 1
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Workbookâ. Are you missing an assembly reference? At line 2
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 3
error BC30002: Type âMicrosoft.Office.Interop.Excel.ApplicationClassâ is not defined. At line 6
error BC31539: Cannot find the interop type that matches the embedded type âMicrosoft.Office.Interop.Excel.Worksheetâ. Are you missing an assembly reference? At line 11
can you please help me here
Restart your program.
It will work fine !!!