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

Free Support Forum - aspose.com

Improvement: should not allow overly-long sheet names

This program produces a valid formula in Sheet1!A1 but a #REF in Sheet1!A2, due to the fact that the sheet name used in the latter is one character too long for Excel.

It would be nice if WorkSheets.Add() and friends threw an exception if you tried to use an invalid sheet name.

using Aspose.Cells;

namespace ConsoleApplication9 {
public class Program {
public static void Main(string[] args) {
var workbook = new Workbook(FileFormatType.Excel2007Xlsx);

var sheet1=workbook.Worksheets["Sheet1"];
const string name2="ThisIsLongSheetNameCloseToLimit";
const string name3="XThisIsLongSheetNameCloseToLimit";
var sheet2=workbook.Worksheets.Add(name2);
var sheet3=workbook.Worksheets.Add(name3);


sheet1.Cells[0, 0].Formula=string.Format("={0}!A1", name2);
sheet1.Cells[1, 0].Formula=string.Format("={0}!A1", name3);

workbook.Save(@"c:\temp\test2.xlsx", FileFormatType.Excel2007Xlsx);

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the details regarding your issue.

We have found your mentioned issue after an initial test. Your issue has been added to our internal issue tracking system with issue id CELLSNET-17405. We will look into it and get back to you soon.

Thank You & Best Regards,


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please try the attached latest version. If the length of the sheet name is greater than 31, an Exception will be thrown as per your requirement.

Thank You & Best Regards,

The issues you have found earlier (filed as 17405) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

While trying to keep the API as straightforward and clear as possible, we have decided to recognize and honor the common development practices of the platform; we have re-arranged API Structure/ Namespaces.

With this release, we have reorganized the API classes for Aspose.Cells component. This change has some major aspects that we follow. We have added new namespaces. The entire API (classes, interfaces, enumerations, structures etc.) were previously located in the Aspose.Cells namespace. Now, certain sets of API have been moved to their relative namespaces, which make the relationship of classes (with their members) and namespaces clear and simplified. It is to be noted here, we have not renamed existing API (classes, enumerations etc.) but, I am afraid you still need to make certain adjustments in your existing projects accordingly.

For complete reference, please see the product's API Reference.