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

Free Support Forum - aspose.com

Is free version do not support color border which cause exception when it is not black border

color border will cause exception while black border is not

@dmwzjdx,

There is no such limitation of evaluation version (using Aspose.Cells without a valid license). Could you please share your sample code (runnable) and attach sample Excel file (if any). We will check your issue soon.

PS. please zip the file(s) prior attaching.

vs2017 C++ ,open excel with color border will cause exception,it is accurately exception at color border displayed by break point

Desktop.zip (18.8 KB)

exception is throwed by GetColor of intrusive_ptrAspose::Cells::IBorder

@dmwzjdx,

Could you please share a sample (runnable) code to reproduce the exception when using your file. We will check and log appropriate ticket(s) (if applicable) for the issue.

PS. please try using our latest version/fix: Aspose.Cells for C++ 22.8 (Download | NuGet)

1 the application exception at color border that is not black ,
every time exception is throwed by GetColor of IBorder

2 SetLineStyle of IBorder is also throw exception while use
IBorder::SetLineStyle got by IBorder::GetLineStyle

3
mcell.exe can show none_color_border.xlsx but can not show color_border.xlsx
which is caused by exception

one_color_border.xlsx and color_border.xlsx is only different between border color

china cloud use mell.exe to open two excels
link:https://pan.baidu.com/s/1671xlE67r63XiG_-axjSuw
code:4zgy

@dmwzjdx,

I tested your scenario/case where it is setting colored border to a cell of a new workbook, it works fine. Here is my sample code that I am using with latest version (as recommended) of the API:
e.g.
Sample code:

/*create a new workbook*/
	intrusive_ptr<IWorkbook> wb = Factory::CreateIWorkbook();

	//Get first worksheet which is created by default
	intrusive_ptr<IWorksheet> ws = wb->GetIWorksheets()->GetObjectByIndex(0);

	//Access cell B1 by cell name
	intrusive_ptr<ICell> cell = ws->GetICells()->GetObjectByIndex(new String("B1"));
	

	//Access the cell style
	intrusive_ptr<IStyle> st = cell->GetIStyle();

	//Fill the cell color to Yellow
	st->SetPattern(BackgroundType_Solid);
	st->SetForegroundColor(Systems::Drawing::Color::GetYellow());

	

	//Set the left border to Red
	st->SetBorder(BorderType_LeftBorder, CellBorderType_Thick, Systems::Drawing::Color::GetRed());
	
	
	//Set the cell style
	cell->SetIStyle(st);

	

	//Save the output excel file
	wb->Save(resultPath->StringAppend(new String("output1.xlsx")));

Please find attached the output Excel file where you can see the colored border is set to the B1 cell.
files1.zip (6.7 KB)

Did you try using latest version Aspose.Cells for C++ v22.8 (Download | NuGet)? If you still find the issue, kindly provide a runnable sample project to reproduce the issue on our end. We will check your issue soon.