Region / Language Issue - Aspose Cells .Net

Hi,

We have created a global web app that uses Aspose Cells to generate specific excel templates.

The problem is that some of our users in countries such Sweden, Denmark and Nordic are having some issues when opening the workbook.

A pop-up window with the following message is displayed: “The name cannot be the same as a built in name”

Does this mean I have to set the Language/Region for the template before writing it? If so, I’ve noticed that the CountryCode enum does not support these countries.

Any help would be appreciated.

Thanks



Hi,

Could you try to call Worksheets.SortNames() method before saving the excel files.

e.g..,

Workbook workbook = new Workbook();
//.......................
//.................... your code goes here
//...................
workbook.Worksheets.SortNames();
workbook.Save("d:\\test\\myoutputBook.xls");

If you still find the problem, kindly provide us the complete details about the issue for those Sweden, Denmark etc. users. Also, give us complete error description, sample code, template files, MS Office versions etc. We will check it soon.

Thank you.

Hi Amjad,

Thank you for your reply. We had to put this bug on hold for a bit hence the reason I hadn't replied to this thread.

I tried the SortNames() method on the workbook object, but there has been no change.

The users experience the issue when opening the file and enabling macro's...but when I try do the same, the file I don not get this issue. This suggests that maybe it’s a locale setting?

A screenshot of the issue has been attached it is in Dutch but translates to:

Names conflict

The name cannot be the same as already existing and included name.

The old name: _FilterDatabase

New name:

The excel template is based on a master workbook that gets copied and customised based on the application selection.

I have also attached some sample code. The code is from the class used to write the Range out, I’m not entirely sure this is where the error is, but given that your proposed solution was based on sorting range names out, I copied and pasted this part of the code.

Any other ideas?

Thanks in advance

Regards

Joe

Hi Joe,

Could you post your created file here so that we may figure out your issue soon.

Thank you.

Hi Amjad,

Again I apologise for the late response.

I've had to prepare an example sheet. I've removed all sensitive data for obvious reasons.

The main sheet is the Royalty Statement work sheet. If you need an explanation for any of the sheets please let me know.

Hope this helps

Thanks

Joe

Hi Joe,

Thanks for providing us the template file.

We will look into your issue and get back to you soon.

Thank you.

Hi Joe,

We could not get any valuable info from your file.

Please post the generated file without opening and saving it in MS Excel. If you save the file in MS Excel, something will be changed and we cannot trace what’s wrong with the generated file. Please simply use Cells.ClearContents method to remove sensitive data. See following codes:


Workbook workbook = new Workbook();

workbook.Open(@“F:\FileTemp\ExampleSheet.xls”);

Cells cells = workbook.Worksheets[“Royalty Statement”].Cells;

cells.ClearContents(6, 0, cells.MaxRow, cells.MaxColumn);

workbook.Save(@“F:\FileTemp\dest.xls”);




BTW,do you use any template file in your App? If yes, please post it too.

Thank you.

Hi Amjad,

I have created a file using the ClearContents method, it has been attached.

Also, we use a master template file for our application. this to has been attached (named MasterMerge.xls).

Thanks again.

Kind regards

Joe

Hi Joe,

Thanks for providing us the template files.

We will look into it soon.

Thank you.

Hi Joe,

After checking your created file, we think you are using some old version of the product.
Please try the new version 4.6.0.12 (attached) and make sure that you call Worksheets.SortNames() before saving the workbook to the file.

Thank you.