By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,569 Members | 1,630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,569 IT Pros & Developers. It's quick & easy.

Q: Viewing an excel file

P: n/a
Hi

Can anybody tell me how I can view an Excel file from within a vb.net
application?

Thanks in advance

G
Nov 2 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
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
Nov 2 '06 #2

P: n/a
Hi

Simply display a read only view of an excel file.

G

"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.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

Nov 2 '06 #3

P: n/a
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" <ro********@yahoo.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.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
Nov 2 '06 #4

P: n/a
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" <ro********@yahoo.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.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" <ro********@yahoo.comwrote in message
news:11**********************@h54g2000cwb.googleg roups.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

Nov 2 '06 #5

P: n/a
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:
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" <ro********@yahoo.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.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" <ro********@yahoo.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.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
Nov 2 '06 #6

P: n/a
On Thu, 2 Nov 2006 12:33:03 -0000, "G .Net" <no********@email.comwrote:

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)
Nov 2 '06 #7

P: n/a
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

"Paul Clement" <Us***********************@swspectrum.comwrote in message
news:dl********************************@4ax.com...
On Thu, 2 Nov 2006 12:33:03 -0000, "G .Net" <no********@email.comwrote:

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)

Nov 2 '06 #8

P: n/a
On Thu, 2 Nov 2006 19:26:55 -0000, "G .Net" <no********@email.comwrote:

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)
Nov 6 '06 #9

P: n/a
Thanks Paul

"Paul Clement" <Us***********************@swspectrum.comwrote in message
news:e3********************************@4ax.com...
On Thu, 2 Nov 2006 19:26:55 -0000, "G .Net" <no********@email.comwrote:

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)

Nov 10 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.