Connecting Tech Pros Worldwide Forums | Help | Site Map

Formatting Excel spreadsheet with asp

Josh Schmidt
Guest
 
Posts: n/a
#1: Jul 22 '05
I'm using the Excel application object to create a
spreadsheet from a recordset. Everything seems to work
fine except any date fields are not displaying properly.
For example 4/18/2004 is displaying as 38095 in the
spreadsheet.

I loop through the recordset to display each row. The
line that actually writes out the field is:

objSpreadsheet.Cells(iRow, iCol).Value = objField.Value

Any suggestions?

Thanks,

Josh Schmidt

Tom Kaminski [MVP]
Guest
 
Posts: n/a
#2: Jul 22 '05

re: Formatting Excel spreadsheet with asp


"Josh Schmidt" <clvrmonkey@quarterjar.com> wrote in message
news:74bd01c4cdbf$98eca630$a601280a@phx.gbl...[color=blue]
> I'm using the Excel application object to create a
> spreadsheet from a recordset.[/color]

Generally not a good idea:
http://support.microsoft.com/default...b;en-us;257757
[color=blue]
> Everything seems to work
> fine except any date fields are not displaying properly.
> For example 4/18/2004 is displaying as 38095 in the
> spreadsheet.
>
> I loop through the recordset to display each row. The
> line that actually writes out the field is:
>
> objSpreadsheet.Cells(iRow, iCol).Value = objField.Value
>
> Any suggestions?[/color]

Display ASP Results Using Excel in IE with MIME Types
http://support.microsoft.com/default...b;en-us;199841

How To Format Cell Data When You Are Creating an Excel File With an Active
Server Pages Page
http://support.microsoft.com/default...b;en-us;260239

How to Create an Office Document in an ASP Application
http://support.microsoft.com/default...b;en-us;301044

To make sure you get formats right, "reverse engineer" the HTML by creating
a sample file in Excel and save it as HTML - look at the resulting HTML as
an example of what you need to do.


Closed Thread