Create Pivot: Failed setting the current sheet to: "SheetName" in workbook

Dear Forum Members,

I am working on an automation solution where I need to create Pivot, then I need to read that Pivot Sheet. But, I am getting the errors: “Create Pivot: Failed setting the current sheet to: “SheetName” in workbook” and “Read Range: Failed setting the current sheet to: “SheetName” in workbook”. I have tried adding kill process as usage of excel is very frequent in the workflow. So, after each create Pivot, I have added Kill process and delay of 5 sec. So that, Pivot should be created before I read that sheet.

I have tried to upgrade RAM as if it could be the issue with System slowness. I have tried to upgrade Excel package but it also didn’t help. I have re-installed MS office but nothing works. The Bot is working on other 2 machines but I need to execute it on the required machine where it is creating issue.

Please suggest any solution. Thanks in advance.

@dimple.khurana

Check the excel settings for any blockers or if excel by default is opening in readonly or safe mode

Excel-> options-> advanced settings

Cheers

@Anil_G ,

Thanks for your response. I have tried the solution suggested by you but it didn’t work. And the problem is issue is not consistent. Create Pivot and read sheet is at multiple places. Somewhere Bot is able to create pivot and read sheet, somewhere it is throwing error.

Regards,
Dimple

@dimple.khurana

Can you show your excel process scope settings

Cheers

@Anil_G ,

Below are the screenshots for Excel process scope, Use Excel File and create Pivot

image


image

@dimple.khurana

Try with launch method automation

Existing process action kill

Process mode new

File conflict close without saving

Cheers

@Anil_G ,

Sure, I’ll try and update if that works or not.

Thanks

1 Like

@Anil_G ,

I have tried the suggestion you given but it gave the same error: Create Pivot Table: Failed setting the current sheet to: “Sheetname” in workbook. Is there anything else which I can try.

Thanks

@dimple.khurana

Once try with show excel true

And also check the create if not exists checkbox

Cheers

Any solutions on this issue ? I am facing same issue as well

Correction: I have found root cause of my issue, it is simply a mistake I have made in the previous activity instead of $A:$G I have used A$:G$ thus automation couldn’t create Table and Pivot as well of course. Maybe you should also check previous activities for the solution.