.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> File Operation >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

To open an workbook in a excel file with excel.application

Posted By:nishithraj       Posted Date: December 02, 2009    Points: 10    Category: File Operation    URL: http://www.dotnetspark.com  

To open an workbook in a excel file with excel.application.

If we use the component Microsoft.Office.interop.excel, we can create the excel work book and save it in a path. It provides another way to open an excel file and work book and work with that.

Following code can be used in this scenario.

objWb = (Excel._Workbook)(objXl.Workbooks.Open(MyFile, 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, false, false));

Here we need to do a type conversion to achieve this using Excel._Workbook.

objXl is the object of excel interop.


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend