Free Support Forum -

Does Aspose.Cells support saving created combobox to GIVEN file-format-type?


When using Aspose.Cells 4.7.1, I found that the created combobox cannot be saved by Workbook.Save ( String fileName, FileFormatType fileFormatType ). Is it possible in Aspose.Cells 4.7.1? Is it possible with latest version?

With 4.7.1, I do can create combobox on an existing workbook (with fileFormatType as 7) and successfully saved it with Workbook.Save ( String fileName ) without giving file extention in the fileName, then change the saved file's extension to xls and open to see the combobox works properly.
Even so, I don't know how to open the saved workbook with Aspose API (since I don't its format), and noticed the locked cells are not locked anymore, is it the same behavior as the latest version?

To illustrate the problematic saving, here is an example:

//Open the existing workbook
FileStream fs = new FileStream(exisitingFilePath, FileMode.Open)
WorkbookDesigner designer = new WorkbookDesigner();
designer.Workbook.Open(fs, (FileFormatType)Enum.Parse(typeof(FileFormatType), (FileFormatType)Enum.Parse(typeof(FileFormatType), "7")));
//Create the combobox
Aspose.Cells.ComboBox comboBox = designer.Workbook.Worksheets[0].Shapes.AddComboBox(2, 0, 2, 0, 22, 100);
comboBox.LinkedCell = "A1";
comboBox.InputRange = "C1:C5";
//Save it
designer.Workbook.Save(@"D:\test.xls", (FileFormatType)Enum.Parse(typeof(FileFormatType), "7"));
` //Then there's NO combobox can be found in the saved excel

Is it a bug in latest version?



Thanks for your posting and using Aspose.Cells for .NET.

The combobox works fine in the latest version. As an example, you can see the following document for your reference.

Also, you can use the following sample code to test the combobox in the latest version. We have also attached the output file generated by the following code.


Workbook workbook = new Workbook();

//Get the first worksheet.

Worksheet sheet = workbook.Worksheets[0];

//Get the worksheet cells collection.

Cells cells = sheet.Cells;

//Input a value.


//Input some values that denote the input range

//for the combo box.







//Add a new combo box.

Aspose.Cells.Drawing.ComboBox comboBox = sheet.Shapes.AddComboBox(2, 0, 2, 0, 22, 100);

//Set the linked cell;

comboBox.LinkedCell = “A1”;

//Set the input range.

comboBox.InputRange = “A2:A7”;

//Set no. of list lines displayed in the combo

//box’s list portion.

comboBox.DropDownLines = 5;

//Set the combo box with 3-D shading.

comboBox.Shadow = true;

//AutoFit Columns


//Saves the file.

workbook.Save( @“F:\Shak-Data-RW\Downloads\tstcombobox.xls”,SaveFormat.Excel97To2003);