We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Add spaces in MS Excel Table's display name in .NET

Hi Guys,

I have a short question.
When I set the property “DisplayName” with the following text “Test Test”, than Excel open the file with an error.
It is probably due to the spaces.
Is it possible to normalize the string and return a error message when set the property?

Code sample:
var workBook = new Workbook(@"C:\Users\MBerthold\Downloads\Test.xlsx");
var table = workBook.Worksheets[0].ListObjects[0].DisplayName = "Test Test";
workBook.Save(@"C:\Users\MBerthold\Downloads\TestSave.xlsx");

Test file:
InputFile.zip (6.1 KB)

Thank you

@moosbart

Thanks for using Aspose APIs.

We have looked into this issue and found, spaces are not allowed in display name of list object. Please see this screenshot that shows the error box by MS-Excel 2016 when we try to assign spaces to display name property.

Besides, we have logged this issue in our database so that in future releases we throw an error (exception) whenever wrong or invalid name is assigned to display name property. This issue has been logged as

  • CELLSNET-45490 - Throw error or exception when wrong name is assigned to ListObject.DisplayName property

@moosbart,

This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-45490”) now. We will soon provide you the fix after performing QA and incorporating other enhancements and fixes.

Once the fix is available for public use, we will share the Download link here.

Thank you

Thank you, for the info.