Error-ReadRangeWorkbook,Object reference not set to an instance of an object

I am using Excel automation to combine multiple Excel sheets(Different workbooks) into a single workbook, including pivot tables.

Initialise the datatable with a assign activity before to this read range like this

dt = New System.Data.Datatable

Cheers @chandrakala.productanalys

Unfortunately, I’m still encountering the same error with no luck."

1 Like

Can you verify if you’ve got the file path configured correctly? Checkout the below link:

Palani’s solution should be working, it is explained in the above link.

It seems like you have the filepath from project folder itself

That is your patches.xlsx file is placed in your project folder itself

Is it or you have the file somewhere
If it’s somewhere make sure you have the complete filepath mentioned here in the activity

@chandrakala.productanalys

The file path is correctly configured. I was able to perform a read range operation on one sheet within the workbook, but I encountered an error while attempting to read the sheets containing Pivot tables.

Is a pivot table in sheet consider as a datatable?

Yeah possibly
Surround that read range activity with try catch activity where in try block have this read range and in catch block include a read range to read the pivot table
Refer this video on how to read pivot table

@chandrakala.productanalys

I watched the video you mentioned, which primarily covers creating and refreshing pivot tables. Do you know of any other methods to transfer a pivot table from one sheet in a workbook to another sheet in a different workbook?

Try with this

Or
This

https://docs.uipath.com/activities/other/latest/productivity/excel-copy-sheet

@chandrakala.productanalys

Can you check the Sheetname and FilePAth was that you are passing correctly

Hi @chandrakala.productanalys ,

If there is no restriction on using Excel Modern activities, then we could try with a combination of For Each File in Folder, Use Excel File, Copy/Paste Range activities. A Sample workflow is provided below :
Excel_Combine_SheetsFromWorkbooks.zip (16.4 KB)

You could check the Input Folder which contains two different workbooks with two sheets then you could execute the workflow, it will generate an Output Excel sheet with all sheets from the Input Folder.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.