Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Excel spredsheet in vb form, but not opening Excel Application 1

Status
Not open for further replies.

YanaD

Programmer
Mar 22, 2001
38
0
0
US
I need to use something like OLE (but with scrolling bar) to view Excel file inside of VB application.
I need exact syntax how to open Excel Sheet ( I have file already) and display it on a form without even opening an Excel application(i need only display the info in the file).
 
The Webbrowser control works good for doing just that. I have used it with Word documents and it works slick. If you need some code, let me know. Anything is possible, the problem is I only have one lifetime.[thumbsup2]
 
no i don't need with webbrowser, I need something simple.
 
Are you looking just to get the text from the Excel file and display it in a list box or something? I guess I need some more details of exactly what you would like to do. Anything is possible, the problem is I only have one lifetime.[thumbsup2]
 
Yes, you are exactly right, I need to display text from excel file in the list box or something that has scroll bar, in order to scroll and view all data.
thanx a lot in advance.
 
To read from an Excel file, do a word search in this forum for "Excel.Application" (without the quotes). You will get hundreds of hits. Then, once you have the data you want, just use the List1.Add method to fill the listbox.
 
Sorry, I need to display not only text from excel file, but it should look like excel sheet, meaning that I can't use list box, I need to diplay excel file without showing the excel application. If you will apply OLE and connect with any Excel file, this view I need to use looking like Excel sheet. Thanx.
 
If you add the Internet controls to your project you can use the webbrowser control to do exactly what you are asking to do. If you name your webbrowser control wbDocument and you place you Excel workbook Book1.xls in the VB Project path the following code will work:

Private Sub Form_Load()


On Error GoTo ErrHnd
wbDocument.Navigate App.Path & "\Book1.xls"
Exit Sub

ErrHnd:
MsgBox Err.Number & " " & Err.Description & " Error Generated By " & Err.Source, vbCritical, "System Error Trap !"
End Sub Anything is possible, the problem is I only have one lifetime.[thumbsup2]
 
you are the best, thanx a million
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top