J
Jonathan
Hi everyone,
I'm having an issue with my Excel streaming. I run my procedure and if
I "Save As" when the dialog opens and then open the file I generate,
it's perfect. Also, if I choose "Open" when Excel is already running,
it's perfect.
If I click "Open" but Excel isn't running, I get an error message:
'C:\...snip...\Temporary Internet
Files\Content.IE5\CPW1639P\export090220061230 [1].xls' could not be
found. Check the spelling of the file name, and verify that the
location is correct.
If you are trying to open the file from your list of most recently used
files on the File menu, make sure that the file has not been renamed,
moved, or deleted.
The file is not, in fact, there in the folder.
I tried generating a more unique filename so that it wouldn't keep
using export.xls and using the [1] all the time, but that did nothing.
My output stream is constructed with:
Response.Cache.SetExpires(DateTime.Now.AddSeconds(1));
Response.Charset = "";
Response.Buffer = true;
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
string datetimeid = DateTime.Now.ToString("MMddyyyyHHmm");
Response.AppendHeader("Content-Disposition", "attachment;
filename=export" + datetimeid + " .xls");
Response.WriteFile(fname); // fname is the file constructed earlier in
the process
Response.Flush();
Response.End();
So why can I save the file and open it up, but I can't open it up right
from the Open/Save As dialog?
Thanks!
I'm having an issue with my Excel streaming. I run my procedure and if
I "Save As" when the dialog opens and then open the file I generate,
it's perfect. Also, if I choose "Open" when Excel is already running,
it's perfect.
If I click "Open" but Excel isn't running, I get an error message:
'C:\...snip...\Temporary Internet
Files\Content.IE5\CPW1639P\export090220061230 [1].xls' could not be
found. Check the spelling of the file name, and verify that the
location is correct.
If you are trying to open the file from your list of most recently used
files on the File menu, make sure that the file has not been renamed,
moved, or deleted.
The file is not, in fact, there in the folder.
I tried generating a more unique filename so that it wouldn't keep
using export.xls and using the [1] all the time, but that did nothing.
My output stream is constructed with:
Response.Cache.SetExpires(DateTime.Now.AddSeconds(1));
Response.Charset = "";
Response.Buffer = true;
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
string datetimeid = DateTime.Now.ToString("MMddyyyyHHmm");
Response.AppendHeader("Content-Disposition", "attachment;
filename=export" + datetimeid + " .xls");
Response.WriteFile(fname); // fname is the file constructed earlier in
the process
Response.Flush();
Response.End();
So why can I save the file and open it up, but I can't open it up right
from the Open/Save As dialog?
Thanks!