After investigate some answers on the web, i realized that funcion cell.SetCellValue has multiple overloadings to set different value types (int, double, string, DateOnly, DateTime, Bool). For example. If you send a numeric value as a string (number.ToString()), the function writes the num as a string on the cell, causing the described behaviour on the question, but if you send an integer or a double without converting it to string, then the function writes the value as number.