An unknown error occurred when executing the 'Switch To Sheet' command. To continue, contact your system administrator.

  • 24 January 2022
  • 10 replies

An unknown error occurred when executing the 'Switch To Sheet' command. To continue, contact your system administrator.

10 replies

Userlevel 4
Badge +7

Hi @damodararao punugubati​ ,


Could you check and verify whether the index/sheet name provided exists?

Also if you are dealing with multiple workbooks, you might what to keep track of the session variables as well.


Kind Regards,

Ashwin A.K

@damodararao punugubati​ 


Could you please add screenshot of the code for more reference?

Hi @Akshaykumar More​ Thanks for your response. The bots in production i cannot share the screenshots but this is the error message i'm getting.

Failed at 193 Error: An unknown error occurred when executing the 'SwitchToSheet' command. To continue, contact your system administrator.

Hi @Ashwin A.K​  Thanks for your response. there is no issue with the sheet names and session name. it working on some times and some times its failing

Userlevel 7
Badge +10

is this issue resolved? if so, would like to understand how was it resolved?

I am also facing the same thing and it's occurring on random occasions. Any solution? @Krishna Rajaraman​ 

I am also facing the issue. Most of the time it works but sometimes it fails.

Hello, I'm from Argentina and I have the same error: "An unknown error occurred when executing the 'Switch To Sheet' command". The bot has to copy information from one excel file to another, and sometimes it does it well and sometimes it throws this error.

Does anybody know what is it due to?.

It occurs randomly but it is preventing the bot from working in a stable way.

The process was programmed in AAv11 and then it was migrated to the AA360 version. In this latest version is where it started to fail.


I hope someone from support can give us an answer.




There is a defect with Excel adcanced package and i had raised the ticket for the same. Support gave me a package (6.8.0) that - most likely will be available in next A360 release.


@Stephen John G Trinidad​  @Carolina Marino​ I would recommend to raise ticket and mention case 01802054 hopefully to get faster response.


Hope this helps.



Badge +1

We are also having a similar issue. Our automation, built in A360, uses workbooks with many worksheets. Because we switch between sheets from time to time, we have some code that checks the current worksheet and if not correct changes:


1) Opens a workbook- assigns a session name

2) Gets the current worksheet name & assigns it to variable 'A'

3) IF variable A doesn't = the worksheet we want

4) Reset variable 'A' to blank

5) Set variable 'B' to the worksheet we want

6) Loop 10x

a) Excel Advanced: Switch to sheet: variable 'B'

b) wait a few seconds

c) Excel Advanced: Get current worksheet name, assign to variable 'A'

d) wait a few seconds

e) IF variable 'A' = variable 'B', exit the loop

f) otherwise continue the loop.


When looking at the error screenshots + logs, it is clear the correct workbook IS open and the correct worksheet IS selected. So, it's unclear if the workbook is opening to the correct sheet, or switching to the desired worksheet correctly. What seems to be happening is: the test to verify the desired worksheet name is failing, so the loop runs, the worksheet name check fails each time & eventually the bot fails.


We reuse essentially identical code in ~12 different places, referencing ~ 8 different worksheets. The automation runs on weekdays & it works most of the time. However, it's failed 19 times since 4/22/2022 (approx 141 days). A failure rate of ~ 13.5%


If anyone has any thoughts, I'd love to hear them.