473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Open Excel WebBrowser

Joe
Hi
Anyone using the WebBrowser with Excel in DotNet 2005???

I have it working with the code below from MS but am trying to eliminate the
following behaviors

1)Stop FileDownload Dialog from Opening
2)Stop Open XML Dialog from Opening
3)Stop a separate Instance of Excel from starting

Thanks

this.axWebBrowser1.NavigateComplete2 += new
AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Even tHandler(this.axWebBrowser1_NavigateComplete2);

private void button1_Click(object sender, System.EventArgs e)

{

String strFileName;

//Find the Office document.

openFileDialog1.FileName = "";

openFileDialog1.ShowDialog();

strFileName = openFileDialog1.FileName;

//If the user does not cancel, open the document.

if (strFileName.Length != 0)

{

Object refmissing = System.Reflection.Missing.Value;

oDocument = null;

axWebBrowser1.Navigate(strFileName, ref refmissing, ref refmissing, ref
refmissing, ref refmissing);

}

}

public void axWebBrowser1_NavigateComplete2(object sender,
AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Even t e)

{

Object o = e.pDisp;

oDocument = o.GetType().InvokeMember("Document", BindingFlags.GetProperty,
null, o, null);

Object oApplication = o.GetType().InvokeMember("Application",
BindingFlags.GetProperty, null, oDocument, null);

Object oName = o.GetType().InvokeMember("Name", BindingFlags.GetProperty,
null, oApplication, null);

MessageBox.Show("File opened by: " + oName.ToString());


}
Sep 29 '06 #1
0 1840

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Perry | last post by:
I have no idea where to start, I just need a general idea if this is possible: Originally I created a vb app that uses the WebBrowser component to view excel files, which seemed to work fine,...
1
by: Gary | last post by:
Is there a way of selecting a specific worksheet in Excel and open it in the webbrowser control in vb.net thank Gary
9
by: G .Net | last post by:
Hi Can anybody tell me how I can view an Excel file from within a vb.net application? Thanks in advance G
1
by: Joe | last post by:
Hi I am able to embed Excel into a WebBrowser on my Dev machine but on a client machine an instance of Excel starts in it's own window. Anyone seen this before??? Thanks
1
by: Joe | last post by:
Hi I have embedded Excel in a WebBrowser on a Form but none of Excels Menus are present Is this the way it is suppose to work??? Do I need to add my own button to print/save excel from...
0
by: morfasie | last post by:
Hi, I am using the code from microsoft Microsoft Webbrowser Excel My problem is, when I click on the excel file to open it, it opens up Office Excel with the file loaded, and nothing happens...
4
by: Gregory Bloom | last post by:
I'm running Python 2.5 under Windows. If I fire up IDLE and enter: it works like a champ, opening the page in Firefox. Same thing goes from a Windows cmd shell: it works as advertised. But...
0
by: arindams | last post by:
I'm getting problem in pasting HTML text in Excel 2007 whereas it is working fine in Excel 2003. The data pasted in excel 2007 is showing the the HTML code which is not desired. I need to have the...
0
by: arindams | last post by:
I've a form where an webrowser contains a html file. I want to copy a selective portion of the html content and paste that content in an excel 2007 file where it will be pasted as a normal text (not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.