- Category: ASP.NET
We can simply open the Spreadsheet or any kinds of documents using C# coding.
Suppose you have spreadsheet in your local or server, then you can implement the following code in the button click event.
System.Diagnostics.Process objDocProcess = new System.Diagnostics.Process();
objDocProcess.EnableRaisingEvents = false;
objDocProcess.StartInfo.FileName = Server.MapPath("Your Excel File Path");
While coding anything related to documents or Spreadsheets kind we need to take care about one thing.
That is Object clearing. Usually this documents or stuff wont come under the .NET Framework runtime CLR.
So Garbage collector wont take care of those process. So we need to manually deallocate those memories.
- #768549Thank you for your response but i need to open the openoffice spread sheet word document on button click in the browser not microsoft word document can you please help me out
- #768554Hi Manigandan can you please delete the post
- #768569basically to open a open office spread sheet on client machine, you need to have a OpenOffice installed on that machine
Process.Start method will not help you as it run on server and you want to open it from client machine
window.open("file:///xxx.xxx.xx.xx(Shared IP Address)/Images/yyyy.pdf");
another way is to use File API
Editor, DotNetSpider MVM
Microsoft MVP 2014 [ASP.NET/IIS]