Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello I have a web form project in which I need to open an .xls file, I have this code:

 

string sysFolder = @"C:";

ProcessStartInfo pInfo = new ProcessStartInfo();

pInfo.FileName = sysFolder + @"\\tjcr.xls";

pInfo.UseShellExecute = true;

Process p = Process.Start(pInfo);

 

When last code line is executed, system remains as it was executing something (a glass hour is shown) but it may remain there for hours not showing Excel sheet.

 

If I place this same code into a project using Windows Form is working OK.

 

My questions are: It�s not possible use this code in a Web Form? What if I need to do it in a web form?

 

I�ll appreciate your comments.

A.L.

  • Administrators
Posted (edited)
Running the above code in ASP.Net will cause Excel to be executed on the server (where it cannot be seen) rather than the client. If you want the worksheet to be opened on the client you will need to provide a link to the sheet so the user is prompted to save / open the document. Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...