I have a problem writing a moderate size Excel spreadsheet if I use numbers instead of text for the number fields.
if I write all fields as text, it creates the whole spreadsheet.
If I create the cells that only have numbers using the numberformat, it gets to row 743, column P, and fails.
It is a valid number, so that is not the problem. And it happens at the sameplace regardless of the actual data.
The exact message is:
The call to member NumberFormat failed. Microsoft Excel returned the following message:
Unable to set the NumberFormat property of the Range class.
Contents of NumberFormat: 1,175
The C/AL statement I am using:
EnterCell(RowNo,16,'',FALSE,TRUE,FORMAT(AmountDueToPrint));
I have searched Mibuso and not found this specific problem.
0
Comments
RIS Plus, LLC
MVP - Business Apps
http://mibuso.com/blogs/davidmachanick/
RIS Plus, LLC
MVP - Business Apps
//Convert to text using format
OnAfterGetRecord()MyPrice := FORMAT("Purchase Line"."Unit Cost ($)");
//Assign it's column & row
EnterCell(Row, 4, MyPrice, FALSE, FALSE, FALSE);
//set the cell format
EnterCell(RowNo : Integer;ColumnNo : Integer;CellValue : Text[250];Bold : Boolean;Italic : Boolean;UnderLine : Boolean) : Text[250]
IF ColumnNo = 4 THEN
TempExcelBuffer.NumberFormat := '#,##0.00'
ELSE TempExcelBuffer.NumberFormat := '0';
http://www.BiloBeauty.com
http://www.autismspeaks.org
One question: should the format be #,###.00 even for large numbers or should it be #,###,###.00 if the number could be over a million?
http://mibuso.com/blogs/davidmachanick/
http://mibuso.com/blogs/davidmachanick/