|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Q: Viewing an excel fileHi
Can anybody tell me how I can view an Excel file from within a vb.net application? Thanks in advance G What do you mean by view? Do you want to host/embed an excel
application or just read the data or something else? Thanks, Seth Rowe G .Net wrote: Show quoteHide quote > Hi > > Can anybody tell me how I can view an Excel file from within a vb.net > application? > > Thanks in advance > > G Hi
Simply display a read only view of an excel file. G Show quoteHide quote "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message news:1162471271.527938.267660@h54g2000cwb.googlegroups.com... > What do you mean by view? Do you want to host/embed an excel > application or just read the data or something else? > > Thanks, > > Seth Rowe > > > G .Net wrote: >> Hi >> >> Can anybody tell me how I can view an Excel file from within a vb.net >> application? >> >> Thanks in advance >> >> G > The easiest way to display an excel file is to use a webbrowser control
and set the url to the target excel file. As far as readonly goes, either tag the excel file as readonly or even use the protection feature to "lock down" all the cells. I'm curious, why not just use a datagrid instead of excel to display the data? Thanks, Seth Rowe G .Net wrote: Show quoteHide quote > Hi > > Simply display a read only view of an excel file. > > G > > "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message > news:1162471271.527938.267660@h54g2000cwb.googlegroups.com... > > What do you mean by view? Do you want to host/embed an excel > > application or just read the data or something else? > > > > Thanks, > > > > Seth Rowe > > > > > > G .Net wrote: > >> Hi > >> > >> Can anybody tell me how I can view an Excel file from within a vb.net > >> application? > >> > >> Thanks in advance > >> > >> G > > Hi Seth
The excel file has graphics and formatting etc. As far as the webbrowser control. Can you give me some example code? Thanks in advance G Show quoteHide quote "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message news:1162475846.774193.152680@k70g2000cwa.googlegroups.com... > The easiest way to display an excel file is to use a webbrowser control > and set the url to the target excel file. As far as readonly goes, > either tag the excel file as readonly or even use the protection > feature to "lock down" all the cells. > > I'm curious, why not just use a datagrid instead of excel to display > the data? > > Thanks, > > Seth Rowe > > > G .Net wrote: >> Hi >> >> Simply display a read only view of an excel file. >> >> G >> >> "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message >> news:1162471271.527938.267660@h54g2000cwb.googlegroups.com... >> > What do you mean by view? Do you want to host/embed an excel >> > application or just read the data or something else? >> > >> > Thanks, >> > >> > Seth Rowe >> > >> > >> > G .Net wrote: >> >> Hi >> >> >> >> Can anybody tell me how I can view an Excel file from within a vb.net >> >> application? >> >> >> >> Thanks in advance >> >> >> >> G >> > > No sample code needed really - you can do it through the designer.
First add the webbrowser control to your form - its under common controls in the toolbox. Next, pull up the properties browser and set the webbrowser's URL property to the excel files directory. That should be it. Thanks, Seth Rowe G .Net wrote: Show quoteHide quote > Hi Seth > > The excel file has graphics and formatting etc. > > As far as the webbrowser control. Can you give me some example code? > > Thanks in advance > > G > > "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message > news:1162475846.774193.152680@k70g2000cwa.googlegroups.com... > > The easiest way to display an excel file is to use a webbrowser control > > and set the url to the target excel file. As far as readonly goes, > > either tag the excel file as readonly or even use the protection > > feature to "lock down" all the cells. > > > > I'm curious, why not just use a datagrid instead of excel to display > > the data? > > > > Thanks, > > > > Seth Rowe > > > > > > G .Net wrote: > >> Hi > >> > >> Simply display a read only view of an excel file. > >> > >> G > >> > >> "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message > >> news:1162471271.527938.267660@h54g2000cwb.googlegroups.com... > >> > What do you mean by view? Do you want to host/embed an excel > >> > application or just read the data or something else? > >> > > >> > Thanks, > >> > > >> > Seth Rowe > >> > > >> > > >> > G .Net wrote: > >> >> Hi > >> >> > >> >> Can anybody tell me how I can view an Excel file from within a vb.net > >> >> application? > >> >> > >> >> Thanks in advance > >> >> > >> >> G > >> > > > On Thu, 2 Nov 2006 12:33:03 -0000, "G .Net" <nodamnspam@email.com> wrote: ¤ Hi¤ ¤ Can anybody tell me how I can view an Excel file from within a vb.net ¤ application? See if the following works for you: How To Use the WebBrowser Control to Open an Office Document in Visual Basic .NET http://support.microsoft.com/kb/304643 Paul ~~~~ Microsoft MVP (Visual Basic) Hi Paul
Thanks for the information. I've tried it successully. However, I was wondering if you could help further? When I open an excel file using Navigate, a dialog appears asking if I want to save or open the file. Can this be avoided so that the file is merely loaded into the component? G Show quoteHide quote "Paul Clement" <UseAdddressAtEndofMess***@swspectrum.com> wrote in message news:dl1kk2534d3amcepkcb9j1f8egrtgi188u@4ax.com... > On Thu, 2 Nov 2006 12:33:03 -0000, "G .Net" <nodamnspam@email.com> wrote: > > ¤ Hi > ¤ > ¤ Can anybody tell me how I can view an Excel file from within a vb.net > ¤ application? > > See if the following works for you: > > How To Use the WebBrowser Control to Open an Office Document in Visual > Basic .NET > http://support.microsoft.com/kb/304643 > > > Paul > ~~~~ > Microsoft MVP (Visual Basic) On Thu, 2 Nov 2006 19:26:55 -0000, "G .Net" <nodamnspam@email.com> wrote: ¤ Hi Paul¤ ¤ Thanks for the information. ¤ ¤ I've tried it successully. However, I was wondering if you could help ¤ further? When I open an excel file using Navigate, a dialog appears asking ¤ if I want to save or open the file. Can this be avoided so that the file is ¤ merely loaded into the component? ¤ ¤ G It's the security mechanism that is implemented for displaying files in the IE browser which can be potentially dangerous. Excel would be on the list since it can contain auto macro code. When the Open/Save dialog pops, there is an option in the dialog which allows you to disable this feature for the file type. If you un check it then the popup warning will no longer be displayed. Paul ~~~~ Microsoft MVP (Visual Basic) Thanks Paul
Show quoteHide quote "Paul Clement" <UseAdddressAtEndofMess***@swspectrum.com> wrote in message news:e3ouk255o3nv4jibqiqoa98lmaii28l1t9@4ax.com... > On Thu, 2 Nov 2006 19:26:55 -0000, "G .Net" <nodamnspam@email.com> wrote: > > ¤ Hi Paul > ¤ > ¤ Thanks for the information. > ¤ > ¤ I've tried it successully. However, I was wondering if you could help > ¤ further? When I open an excel file using Navigate, a dialog appears > asking > ¤ if I want to save or open the file. Can this be avoided so that the file > is > ¤ merely loaded into the component? > ¤ > ¤ G > > It's the security mechanism that is implemented for displaying files in > the IE browser which can be > potentially dangerous. Excel would be on the list since it can contain > auto macro code. > > When the Open/Save dialog pops, there is an option in the dialog which > allows you to disable this > feature for the file type. If you un check it then the popup warning will > no longer be displayed. > > > Paul > ~~~~ > Microsoft MVP (Visual Basic)
Get Calling Function Info
How to set OpenFileDialog to "My Computer" Problems with references DataGridView Row Simple dataset update @ runtime not working How to Transfer an Excel Range to an ADO.Net DataSet or DataTable in VB.Net? Diagnostic Information Collation Problems when try to launch word in server 2003 Delete files/directories through VB Net beginning vb |
|||||||||||||||||||||||