Framework 1.1 - opening Excel file

S

stainless

Currently, we are opening Excel files using the Response option:

Response.ContentType="application/x-msexcel";
Response.AddHeader("Content-Disposition", "attachment; filename=" + localFileName);
Response.WriteFile(fileName);
Response.Flush();
Response.Close();

filename is the actual Excel file (contains a macro) and localFileName is asuggested name for saving the data file produced.

I am looking at allowing the called Excel to take in command line parameters using a GetCommandLine function in the Excel VBA (have tested Excel code tp do this and can read the full command line) but have not found a way of changing the C# code above to pass this through. Unfortunately, we are stuck with Framework 1.1 for the time being so need a solution that is compatible. Any ideas?

Cheers

Mark
 
J

Jeff Johnson

Currently, we are opening Excel files using the Response option:

Actually, you're not opening them, you're transmitting them.
Response.ContentType="application/x-msexcel";
Response.AddHeader("Content-Disposition", "attachment; filename=" +
localFileName);
Response.WriteFile(fileName);
Response.Flush();
Response.Close();
filename is the actual Excel file (contains a macro) and localFileName is
a suggested
name for saving the data file produced.
I am looking at allowing the called Excel to take in command line
parameters using
a GetCommandLine function in the Excel VBA (have tested Excel code tp do
this
and can read the full command line) but have not found a way of changing
the C# code
above to pass this through. Unfortunately, we are stuck with Framework 1.1
for the time
being so need a solution that is compatible. Any ideas?

I doubt this will ever happen, regardless of the .NET framework version.
There may not even be an equivalent of a command line on the client side,
and I also doubt that there's any mechanism to specify switches for it even
if it exists.

Simply put, executing a program to handle the received file is up to the
client (the browser), and has nothing to do with .NET.
 

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

Top