Excel加载项卸载,检查Excel是否已打开。 [英] Excel Add-in Uninstalling, check whether Excel is opened or not.

查看:469
本文介绍了Excel加载项卸载,检查Excel是否已打开。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我已经实现了一个Excel加载项。

I have Implemented an Excel Add-in.

我已经创建了一个设置并在用户的安装中安装了它机。它运行正常。

I have created a setup and installed the same in the User's Machine. It is working properly.

当Excel打开并且用户正在进行一些操作时。

When the Excel is opened and user, is making some operations.

在Middle中,他来到控制面板并卸载已安装的加载项。

In Middle, he comes to Control Panel and uninstall the Installed add-in.

即使卸载了加载项,用户也可以在打开的工作中执行所有操作。

Even though the Add-in is uninstalled, user is able to perform all the operations in the opened work.

为了不发生这种情况,我打算按照以下方法。

In order not to happen this, i am planning to follow the below approach.

在卸载加载项时。

我必须检查,是否有任何打开的Excel工作簿。

I have to check, whether there is any opened Excel workbook.

如果打开,我应该向用户显示一条消息,说"请关闭打开的Excel工作簿并完成流程"

if opened, i should show a message to user, saying "Please close the Opened Excel Workbooks and complete the process"

但我不知道,应该使用哪个事件以及如何与设置相关联。

But i don't know, which Event should be used and how that will be associated with the setup.

根据我的研究,我是能够找出 " WorkbookAddinUninstall "事件但不太确定,这是否有用。

As per my research, I was able to figure out the "WorkbookAddinUninstall" Event but not pretty sure, whether this will be useful or not.

如果有用,不知道如何使用和检查Excel流程。

If useful, don't know how to use and check for the Excel Process.

如果此事件的任何示例代码如何工作并检查打开的Excel实例将对我有所帮助。

If any sample code how this event will be working and to check for opened Excel Instance will be of helpful to me.

谢谢

Nihar

推荐答案



这是一个示例代码,用于估算Excel的进程是否正在运行。 (VB.NET)

Hi,
This is a sample code that estimates if a process of Excel is running. (VB.NET)
Dim proc As System.Diagnostics.Process
For Each proc In System.Diagnostics.Process.GetProcesses()
    If (proc.ProcessName = "EXCEL") then
	MessageBox.Show("Excel is running.")
    End If
Next





这篇关于Excel加载项卸载,检查Excel是否已打开。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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