Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading CSV file to Excel with IE

Status
Not open for further replies.

markbinau

Programmer
Mar 26, 2002
5
0
0
US
I am attempting to allow our customers to download a text file which they could then easily use in MS Excel or other application. I thought a CSV file would be perfect for this application. When I use the .csv extension, I.E. sniffs this and opens the file in Excel in the browser. This sounds like what I want, however, it opens it as if it were a tab delimited file instead of a comma delimited file.

Does anyone know a good work around for this issue?

Thanks,
Mark
 
Try right click and 'save as' in IE, then you should be able to manually open it with Exel correctly.
 
Thank you for your reply. You are correct that will work, but it is not the solution I am looking for. I actually have a Java applet that the user can select to print a report from or download the data. When they choose download, I want it to immediately start downloading and would not mind if it opened in Excel or when the download is complete and the user chooses open it then opens in Excel. That is what happens now, it just opens with everything in the first column because it is trying to open the comma separated file as if it were tab delimited.

I welcome ideas from everyone.

Thanks,
Mark
 
Can't you just add quotation marks around your data when you generate the CSV file? Excel will break the following example into 3 columns and 2 rows:

"Column 1","Column 2","Column 3"
"C1, Row 2","C2, Row 2","C3, Row 2"
 
No, strangely enough from within I.E. it will put all three of your columns in the first column of the spreadsheet. It does not actually open a separate instance of Excel. Instead it opens an applet of Excel in the browser window. The applet of Excel seems to think the file is tab delimited instead of comma delimited. This seems like a bug in I.E. but I have not found any work around for it in the MS knowledge base.

Thanks for your reply...any more ideas??
 
Okay - - let's talk about specs...

What versions of IE/Excel are you using? What platforms?

This works okay on my set-up (Excel 97, IE 5 & 6).

What about your users that use Opera, Netscape or Mozilla?
 
I.E. 5.0, 5.5 and 6.0 running on WinNT and Win2000. On the NT platform they are running Office 97 and Win2K they are running Office 2K.

In Netscape it prompts the user to save or open in Excel. If the user chooses to open, it will open a completely separate instance of Excel and correctly open the file. I have not tested Opera.

I think if I.E. would open a separate instance of Excel it might work. Does anyone know how to force it to open a separate instance rather then openning Excel as part of the browser?

I have found sort of a work around. By changing the file to be tab-delimited .txt file instead of a .csv file Excel will open this correctly in the browser version of Excel.

Thanks,
Mark
 
On my companies web site we had this same problem about two years ago. We found that it was due to file associations in the Windows folder options.
We had to create a CSV type of extention and associate it with "Microsoft Excel Comma Seperated Values File".
The action open had to be added and then associated with Excel's executable. Last we checked the confirm download after open dialog.

Shannon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top