Code to open a workbook of excel from a uploaded file

Nishithraj
Posted by Nishithraj under C# category on | Views : 1590
Let us consider a file has been uploaded and it is saved at some where.
We can open the work book as shown below.


FileUpload1.PostedFile.SaveAs(StrFileLoc);
xl = new Excel.Application();
wb = (Excel._Workbook)(xl.Workbooks.Open(StrFileLoc, 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, false, false));

Comments or Responses

Login to post response