| | |
Open Excel Sheet in Vb.net
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Apr 2007
Posts: 5
Reputation:
Solved Threads: 0
Hi,
I have an excel file,having lot or micros, connecting to database, doing some complex calculation..inshot that excel file is itself an application.
Now I want to open that excel in VB.net form, on button click. I prefer to open that excel in vb.net form itself having all the excel tool bar etc, If that is not possible then opening in separate window using excel will also solve my purpose (coz when we open in excel it self we will get all the toolbar option etc automatically)
Please Help
Anurag
•
•
Join Date: Apr 2007
Posts: 5
Reputation:
Solved Threads: 0
No reply from any one here ..but i found the solution from other sources..
To open in vb form :
1) Add com component "Microsoft Web browser" [by right click on toolbox select add/remove item]
2) You will get a new tool "Microsoft Web Browser"
3) Drag control to your form
4) Write this line on some button click or form load
However opening file in form using webbrowser is giving me some problem as my excel sheet is having VBA code, but for normal excel file it will work.
Alternate way is, open in separate window using excel:
Method 1=>
Method 2=>
Add Microsoft excel 10.0 as reference
Enjoy!!
anurag_shr
To open in vb form :
1) Add com component "Microsoft Web browser" [by right click on toolbox select add/remove item]
2) You will get a new tool "Microsoft Web Browser"
3) Drag control to your form
4) Write this line on some button click or form load
VB.NET Syntax (Toggle Plain Text)
AxWebBrowser1.Navigate("C:\test1.xls")
However opening file in form using webbrowser is giving me some problem as my excel sheet is having VBA code, but for normal excel file it will work.
Alternate way is, open in separate window using excel:
Method 1=>
Imports System.Diagnostics Dim ps As New ProcessStartInfo ps.UseShellExecute = True ps.FileName = "C:\test1.xls" Process.Start(ps)
Method 2=>
Add Microsoft excel 10.0 as reference
Imports Excel.WorkbookClass Imports Excel.WorksheetClass Imports Excel.ApplicationClass Dim xlsApp As Excel.ApplicationClass Dim xlsWB As Excel.WorkbookClass Dim xlsSheet As Excel.WorksheetClass xlsApp = New Excel.ApplicationClass xlsApp.Visible = True xlsWB = xlsApp.Workbooks.Open("C:\test1.xls")
Enjoy!!
anurag_shr
Last edited by anuragNet; Apr 24th, 2007 at 11:14 pm.
![]() |
Similar Threads
- Retriving data from excel sheet into an asp page (ASP)
- Open Excel Sheet in Vb.net (VB.NET)
- Open Excel file from Visual Basic (Visual Basic 4 / 5 / 6)
- 1 .Exporting data from Dataset to XLl sheet in VB.net Windows Application &vice versa (VB.NET)
- To Fetch EXCEL sheet values thro' ASP page. (Existing Scripts)
Other Threads in the VB.NET Forum
- Previous Thread: Help me please
- Next Thread: Check Whether The Next Attribute Is Exists Or Not?
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account add application array basic beginner browser button buttons center check click code combo cpu crystalreport cuesent database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel exists fade file-dialog filter forms ftp generatetags html images input insert intel listview mobile module monitor mysql net number open output panel passingparameters picturebox picturebox2 port print printing printpreview problem regex reuse right-to-left searchvb.net select settings shutdown socket sqldatbase sqlserver storedprocedure survey tcp temperature textbox timespan transparency trim txttoxmlconverter user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet vista visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





