Create new worksheet in excel

Hi, I am trying to create a new excel and create a new worksheet and finding it difficult to figure out the exist_ok argument in creating a worksheet.

The issue here is when I use true or false with the sheet name already exist it is not throwing any error.

The code goes like below:
*** Keywords ***
Create new excel
Create Workbook fmt=xlsx
Create Worksheet Data None True False
Save Workbook ${filename}

I tried creating two sheet with same name and exists_ok=False, but it seems to fail

1 Like

Hi @Teppo, I haven’t tried this scenario of creating two worksheets at the same time.
Let’s say excel already has a sheet named Data but I am trying to create it again?
Will that throw any error?

Thanks for your reply.

Yes it does
You probably saw an error as given example has exist_ok set to True
Create Worksheet Data None True False


Hi @Raivo and @Teppo
I got it. The reason is I was creating a new excel every time.
Thanks for your response.

1 Like