PC Review


Reply
Thread Tools Rate Thread

Framework 1.1 - opening Excel file

 
 
stainless
Guest
Posts: n/a
 
      10th Aug 2012
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
 
Reply With Quote
 
 
 
 
Jeff Johnson
Guest
Posts: n/a
 
      10th Aug 2012
"stainless" <(E-Mail Removed)> wrote in message
news:ea7879c6-ecaf-4a49-a6a5-(E-Mail Removed)...

> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for Opening Reuters, Opening Excel File, Closing Excel File Tsp245 Microsoft Excel Programming 2 14th Aug 2008 07:24 PM
Opening a file... any file (cross-posted microsoft.public.dotnet.languages.vb;microsoft.public.dotnet.framework.windowsforms.controls) Mark Microsoft VB .NET 9 8th Jun 2005 05:39 PM
.NET Framework service pack 2 failed to install. .NET Framework on =?Utf-8?B?S2lyaw==?= Windows XP Help 2 15th Oct 2004 06:27 PM
Framework 1.1 on XP Client won't load Framework 1.0 Programs from App.Server =?Utf-8?B?SGVpa28=?= Windows XP General 2 23rd Jan 2004 04:37 AM
simple TCP socket connect (emulator - framework FAIL); framework - framework - Works [Help will be compensated] Yechezkal Gutfreund Microsoft Dot NET Compact Framework 0 16th Jul 2003 06:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 AM.