| | |
Open Excel Sheet in Vb.net
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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 |
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic binary bing box button buttons click code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists file-dialog firewall folder google hardcopy image images isnumericfuntioncall login math memory mobile module ms msaccess mssqlbackend mysql navigate net networking opacity output peertopeervideostreaming picturebox1 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left save savedialog serial sqldatbase storedprocedure string temp text textbox timer toolbox updown useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml





