Hi everyone,
I have a problem with my excel export.
I am generating an excel file from a dynamics ax 2009 class. Every 3 column, I want to mark a separation with a border on the right of each cell of the colum. I have a method which add a complete border on the cell (right, left, bottom, top) but I don’t know how to put it on the right only.
Here is my method (which works fine):
public void setBorderToCells(str range)
{
SysExcelRange xlsRange;
SysExcelStyle xlsStyle;
COM comObject;
;
xlsRange = worksheet.range(range);
comObject = xlsRange.comObject();
comObject = comObject.borders();
comObject.color(0);
}
I also tried this code found on the internet but when I execute it, Dynamics crash and I have the error message “Dynamics Ax stopped working”.
cell = cells.item(row, col);
cellCOM = cell.comObject();
borderType.int(4); // 4 = right border
borders = cellCOM.borders();
border = borders.item(borderType);
lineType.int(1);
border.lineStyle(lineType);
What can I do?
Thank you in advance.