Excel文件未在webbrowser控件中打开 [英] Excel file not opening in webbrowser control

查看:201
本文介绍了Excel文件未在webbrowser控件中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在窗口窗体中打开/嵌入excel文件进​​行预览。我使用了WebBrowser控件和使用方法

Hi,
I want to open / Embed a excel file in a Window Form for preview. I have used WebBrowser control and using method

webBrowser1.Navigate(filename,false);



这将在新的Excel窗口中打开excel文件,但我希望它在该webform控件中打开。

办公室版 - Office 2013 x86

互操作版 - x86



请帮帮我。



我尝试过:



尝试将CPU从AnyCPU更改为x86也。但那并没有奏效。仍然excel打开作为一个新的Excel窗口。尝试了xls和xlsx格式。


This opens the excel file in a new excel window but i want it to be open within that webform control.
office version - Office 2013 x86
interop version - x86

Please help me out.

What I have tried:

tried changing the CPU from "AnyCPU" to "x86" also. But that didnt worked. Still excel opens as a new excel window. Tried both xls and xlsx formats.

推荐答案

.NET的浏览器控件实际上使用了IE及其设置...

的方式最终用户决定打开的文档(有一些默认值),所以你不能强迫嵌入或不嵌入文档......
The browser control of .NET actually uses IE and it's settings...
The way a document to be opened decided by the end user (with some defaults), so you can not force a way to embed or not a document...


这篇关于Excel文件未在webbrowser控件中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆