Click here to Skip to main content
15,899,754 members

Comments by Blackth_rn (Top 4 by date)

Blackth_rn 21-Dec-22 9:51am View    
I just tried converting it there instead of casting and it worked. Thank you for explaining it!
Blackth_rn 21-Dec-22 8:30am View    
Sorry I misread your message. It doesn't show any error when I use your solution with .Value?.ToString(); it just prints it as a string
Blackth_rn 21-Dec-22 8:24am View    
An error only appears when I try to convert to double. The one I get is: System.InvalidCastException: 'Unable to cast object of type 'System.String' to type 'System.Double'.' ETA - The error appears at the line: worksheet.Cells["B" + current_line_number].Value = (double)data_holder.Rows[i].Cells[0].Value;
Blackth_rn 21-Dec-22 8:17am View    
Thank you for getting back to me! I didn't realize that null operators were a thing. I just tried your solution there but it still wants to be passed as a string.