I am creating a report in my ASP.NET application. The report outputs to Excel using the Excel interop. Some calculations in the report cause Excel to display “INF” or “NaN”. I want to force these calculations to zero so that the report displays zero and NOT “INF” or “NaN”.
Share
Are you looking to do this on the Excel side, after the value is populated as “Inf” or “NaN”? If so, running this VBA code will replace all your non-numeric values with 0.