RE: Error and double open dialog when downloading Excel file from ASP.NET.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: [MSFT] (lukezhan_at_online.microsoft.com)
Date: 03/29/04


Date: Mon, 29 Mar 2004 03:39:08 GMT

Hi Lowell,

I tried your code and I haven't been able to reproduce the problem. If you
open the excel file in IE like:

Response.ClearHeaders();
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";

'Response.AddHeader("Content-Disposition", "attachment;filename=" +
sNameOnly);
'Response.AddHeader("Content-Length", sFileLength);

Response.WriteFile(sFileName);

Will this work without errors?

addtionally, if you pass a csv or txt file instead or .xls. will it also
generate the error?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Relevant Pages

  • Re: Whjere is a file created?
    ... One might learn to love more about Access were one to phrase one's ... questions so that they do not imply a route for the answer. ... It creates an Excel file, ... Many times we see someone posting back to say, "Well, your solution ...
    (comp.databases.ms-access)
  • RE: Slow Network Files/Programs
    ... then open the Excel file. ... your questions to the following news group: ... When responding to posts, please "Reply to Group" via your newsreader so ... This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.windowsxp.general)
  • Re: XP cant open Excel file created on win98se
    ... that line code into a posting and let us have a look. ... HTH. ... > I create an excel file using XL97sr2 running under win98se ... > the following XL97sr2 error message when trying to open ...
    (microsoft.public.excel)
  • Re: Create DLL
    ... if you will use Visual Studio Tools For Office to create the DLL I can ... tell you that is more secure than Excel file with VBA but... ... It's not secure on 100% as it uses Framework and IL code... ...
    (microsoft.public.excel.programming)
  • Re: Excel - Passwords
    ... I'm not planning to distribute this excel file - and it is doubtful anyone ... security features. ... If I want the contents of this file to be more secure, ... It is an eye-opener how easy it is to get access to an Excel file! ...
    (microsoft.public.excel.programming)