Article ID: 260239 - Last Review: February 12, 2007 - Revision: 2.2 How To Format Cell Data When You Are Creating an Excel File With an Active Server Pages PageThis article was previously published under Q260239 SUMMARY
This article demonstrates how to format a field to preserve the leading digits (such as the "000" in "0001112") or a specific formula when you create an Excel file with an Active Server Pages (ASP) page.
MORE INFORMATION
If you set the
Response.ContentType = "application/vnd.ms-excel" 199841
(http://support.microsoft.com/kb/199841/EN-US/
)
How To Display ASP Results Using Excel in IE with MIME Types
If the table field has a leading zero, then the zero (or zeros) will be stripped because Excel treats the field as a numeric value.You can specify the cell as a string value to preserve the format in the ASP page. You can even specify the formula for calculation in your code. The following page, Test.asp, demonstrates how you can do this: REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
247318
(http://support.microsoft.com/kb/247318/EN-US/
)
BUG: Word 2000 and Excel 2000 Do Not Redirect Correctly When Using Response.Redirect
264143
(http://support.microsoft.com/kb/264143/EN-US/
)
FIX: ASP Session Variables Empty When Office 2000 MIME Types Are Streamed with Internet Explorer
APPLIES TO
| Article Translations
|

Back to the top
