关闭在AxWebBrowser中打开的Excel [英] Close an excel opened in AxWebBrowser

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

问题描述

我正在VB.net 2005创建的窗口窗体上的AxWebBrowser(这是我最简单的方法)中打开一个现有的Excl工作表.

我的问题是我无法:关闭文件,因此当我尝试打开另一个文件或在硬盘上覆盖同一文件时,我无法执行此操作.

我也找到了运行在任务管理器中的excel exe.

如何解决这些问题?

注意事项
Nishkarsh

I am opening an existing Excl sheet in a AxWebBrowser (that''s the easiest way i got) on a window form created by VB.net 2005.

My issue is that i am not able to : close the file so when i try to open another file or over write the same file (on HDD) i am not able to do it.

Also i find the excel exe (in the task manager) running in the back which is not freeing the excel.

What can be done to solve these issues?

Regards
Nishkarsh

推荐答案

尝试此操作
只是从应用程序的任务管理器中杀死excel进程.

请使用以下代码.



Public Sub Kill_Application(ByVal ApplicationName As String)
试试
Try
Dim processList1()As Process
processList1 = Process.GetProcessesByName(ApplicationName)
对于每个proc作为processList1中的Process
proc.Kill()
下一页
猫ch
结束尝试
异常捕获
MsgBox(ex.Message)
结束尝试
结束子

try this
just kill the excel process from the task manager, from your application.

use this below code.



Public Sub Kill_Application(ByVal ApplicationName As String)
Try
Try
Dim processList1() As Process
processList1 = Process.GetProcessesByName(ApplicationName)
For Each proc As Process In processList1
proc.Kill()
Next
Catch
End Try
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub


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

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