asp to excel number formatting

M

Mike

I am trying to save a number to excel using the correct number of digits. In
asp I write a number out to HTML formated as "4.50". I now want run that
page and save the results as an excel page.

I add Response.ContentType="application/x-msdownload"

and now the number displays as "4.5" in excel. I have tried to CStr(4.50)
when going to excel but that doesn't help.

How do I show the number of decimals I want??

Thanks
Mike
 
T

Tom Kaminski [MVP]

Mike said:
I am trying to save a number to excel using the correct number of digits.
In
asp I write a number out to HTML formated as "4.50". I now want run that
page and save the results as an excel page.

I add Response.ContentType="application/x-msdownload"

and now the number displays as "4.5" in excel. I have tried to CStr(4.50)
when going to excel but that doesn't help.

How do I show the number of decimals I want??

For things like this I like to "reverse engineer" the answer. Create the
spreadsheet in Excel and save it as HTML then look at the resulting code.
 
M

Mike

Thanks. That's a good tip, but damn what an ugly solution! I have many
columns of data that will need many different styles.

Thanks again
Mike
 
M

Mike

Will Excel recognize external stylesheets? I have tried everyway I know how
to use and external stylesheet to work and I keep getting an error when
opening the excel page. Here is the error "Problems came up in the following
areas during load. -
Missing file: ...Temporary Internet Files\Content.IE5\VIAA3848\ExcelStyle.css"

This is with the css file in the same directory as the file and trying to
access it using this code.

response.write "<link rel=stylesheet href=""ExcelStyle.css""
type=""text/css"">"

Any ideas?

Thanks again
Mike
 
T

Tom Kaminski [MVP]

Mike said:
Will Excel recognize external stylesheets? I have tried everyway I know
how
to use and external stylesheet to work and I keep getting an error when
opening the excel page. Here is the error "Problems came up in the
following
areas during load. -
Missing file: ...Temporary Internet
Files\Content.IE5\VIAA3848\ExcelStyle.css"

This is with the css file in the same directory as the file and trying to
access it using this code.

response.write "<link rel=stylesheet href=""ExcelStyle.css""
type=""text/css"">"

Any ideas?

I have no experience with that. Maybe give it a more absolute reference?
 
M

Mike

I gave it an absolute address and that doesn't work either. I guess I'll
just add the style to each asp that creates an excel.

Thanks for your time.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top