Error Regarding Sheet Name Longer Than 31 Characters

Hello,

I am processing a large number of Excel files using For Each Excel Sheet. I am getting an error that the sheet name exceeds 31 characters:

image

However, the subject sheet names are, “Summary” and "10.2022. How can I best deal with this error?

Thanks!

That’s not the filename, that’s the sheet name. Sheets are the tabs inside the file.

Hi @worldwynj,

We cannot use more then 31 characters

Best,

Hi @worldwynj

Excel does not by default allow that its a limitation on it

If you are trying to create sheet then check the length of name and reduce to 31 characters before creating

cheers

Thanks for your relply. Yes, it is the Sheet Name that is cited in the error message. However, the names of the sheets are “Summary” and “10.2022” which are significantly less that 31 characters.

Any ideas what is going on?

Hi Raj Kumar,

Thanks for your reply. I do not have a choice about the sheet names as I am not creating them. In addition, the names of the sheets are significantly shorter than 31 characters, “Summary” and “10.2022”.

Any ideas what is going on?

Thanks!

Hi Anil G,

Thanks for your reply. I do not have a choice about the sheet names as I am not creating them. In addition, the names of the sheets are significantly shorter than 31 characters, “Summary” and “10.2022”.

Any ideas what is going on?

Thanks!

Hi @worldwynj

Can you try printing the sheetname and check for which sheet it is failing

And see if you can copy that sheet into a new excel and are able to access?

Some files might be corrupted and might throw error as such

Cheers

Show us the activity that is failing.

Hi @Anil_G,

Thanks for your suggestion. Printing the sheet name exposed the problem. I made a slip in my syntax. In referencing the sheet I used, ExcelReport.Sheet(CurrentSheet.ToString) rather than ExcelReport.Sheet(CurrentSheet.Name)

Thanks again!

1 Like

Hi @worldwynj

Happy Automation.

Cheers

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