473,385 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Response.ContentType = "application/ms-excel"

I have created an Excel spreadsheet for the web. When it opens in IE
6.0 I get the message that the format is not supported. This is because
it is in tab delimited format. Ane when I save the file, It saves it as
txt. How can this file be created so that Excel sees it as an .xls
format. I created the data in VB 6.0 with a vbtab to seperate the
columns.

Hope this is enough information.

Thanks for the help,
Jim

Oct 26 '05 #1
4 54753
Create an actual Excel file. A tab delimited file is not the same as an
Excel file. You created the file programatically?

If you do it as a csv and give it a csv extension, it's more than likely
that it'll open in Excel on most machines. But even then, that does not
mean that it's an Excel file. It's then just a comma separated values file.

Ray at work

<jr********@idealas.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have created an Excel spreadsheet for the web. When it opens in IE
6.0 I get the message that the format is not supported. This is because
it is in tab delimited format. Ane when I save the file, It saves it as
txt. How can this file be created so that Excel sees it as an .xls
format. I created the data in VB 6.0 with a vbtab to seperate the
columns.

Hope this is enough information.

Thanks for the help,
Jim

Oct 26 '05 #2
I didn't notice the subject and that you were setting the application type.
If you're going to do that, just return an html table, not tab delimited
data. Excel will handle converting an html table to a spreadsheet.

Ray at work

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2***************@TK2MSFTNGP10.phx.gbl...
Create an actual Excel file. A tab delimited file is not the same as an
Excel file. You created the file programatically?

If you do it as a csv and give it a csv extension, it's more than likely
that it'll open in Excel on most machines. But even then, that does not
mean that it's an Excel file. It's then just a comma separated values
file.

Ray at work

<jr********@idealas.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have created an Excel spreadsheet for the web. When it opens in IE
6.0 I get the message that the format is not supported. This is because
it is in tab delimited format. Ane when I save the file, It saves it as
txt. How can this file be created so that Excel sees it as an .xls
format. I created the data in VB 6.0 with a vbtab to seperate the
columns.

Hope this is enough information.

Thanks for the help,
Jim


Oct 26 '05 #3
AFAIK this is not the proper mime type.

Try :
.xls application/excel
.xls application/vnd.ms-excel
.xls application/x-excel
.xls application/x-msexcel
(from http://www.webmaster-toolkit.com/mime-types.shtml)

I used the second one...
--

<jr********@idealas.com> a écrit dans le message de
news:11**********************@f14g2000cwb.googlegr oups.com...
I have created an Excel spreadsheet for the web. When it opens in IE
6.0 I get the message that the format is not supported. This is because
it is in tab delimited format. Ane when I save the file, It saves it as
txt. How can this file be created so that Excel sees it as an .xls
format. I created the data in VB 6.0 with a vbtab to seperate the
columns.

Hope this is enough information.

Thanks for the help,
Jim

Oct 26 '05 #4
Here is the code that I have...

For Each eXml In xnlXml
For Each aAttr In eXml.Attributes
If aAttr.baseName <> "balance_due" Then
sXLSFile = sXLSFile & aAttr.Value & vbTab
Else
sXLSFile = sXLSFile & aAttr.Value & vbCrLf
End If
Next aAttr
Next eXml

Randomize
sFileName = Server.MapPath("dreamreport") & CStr(CInt(Rnd(100) * 1000))
& ".xls"
Set oFso = CreateObject("Scripting.FileSystemObject")
oFso.CreateTextFile sFileName
Set fFile = oFso.GetFile(sFileName)
Set tStream = fFile.OpenAsTextStream(ForWriting)

Then sFileName and sXLSFile are sent to..

bRtn = True
Response.Expires = 0
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "inline; filename=" &
p_bstrFilename
Response.AddHeader "Content-Length", LenB(p_vBuffer)
Response.BinaryWrite p_vBuffer

And I still get that message that the file cannot be recognized.

Thanks for any help,

Jim

Oct 26 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Microsoft | last post by:
I'm trying to display a word document inside a web page, but everytime I do I get this error: Error Type: Microsoft VBScript runtime (0x800A0046) Permission denied: 'CreateObject' Does...
2
by: dave | last post by:
Hello Can any one suggest me how to create pdf on the fly... I had already checked link http://www.aspfaq.com/show.asp?id=2207 but I cannot use third party component as site is not hosted some...
5
by: TJS | last post by:
trying to display pdf file in browser fails on this line: Response.ContentType = "application/pdf" getting an error about no declaration found for "response" what declaration is needed ???
5
by: TomislaW | last post by:
What is asp.net equivalent for Application("Root") in asp?
5
by: David Lozzi | last post by:
Hello, this is a repost of a previous post of mine from today. I need to export multiple documents (doc, xls, ppt, jpg) and crystal reports to a single PDF file. I know how to export a single...
6
by: farmer | last post by:
Compiler Error Message: CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement And: (int)Application++; Makes no sense.
9
by: DJ Tuneman | last post by:
I've noticed that if I enable the "Application Framework" in the project for a Windows app, there's a bug when the programs load and I didn't even notice it until lately. If you click the "Show...
13
by: Kobee | last post by:
Hi, I'm having a few issues adapting to new 2.0 "website" project vs. the old 1.1 "web application". One of the major issues I'm having is with the notion of namespaces. Using the old way, I...
3
by: rdudejr | last post by:
Hi all, Ive got a database approx 350 GB in which Im getting very high Time waited for prefetch. This is directly out of the snapshot for the db (these are for the entire database I assume as I...
4
by: Bjorn Sagbakken | last post by:
With ASP.NET 2.0 I'm trying to display the pdf file directly in the client browser, but I only get a download dialogue box. Downloading the file works fine, but I want to view the PDF directly. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.