在窗体打开时显示消息框将在窗体关闭时最小化Excel [英] Displaying a message box while a form is open will minimise Excel when the form is closed

查看:204
本文介绍了在窗体打开时显示消息框将在窗体关闭时最小化Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Excel应用程序级别vsto中,我显示一个表单。如果用户选择了无效选择,则会显示一个消息框以通知他们。用户选择"确定"以删除消息框,并可继续使用表单。

In my Excel Application level vsto I display a form. If the user selects an invalid selection it displays a message box to inform them of this. The user selects OK to remove the message box and can continue with the form.

如果用户随后关闭表单,由于某种原因,Excel将同时最小化。

If the user then closes the form, for some reason Excel is minimised at the same time.

在表单打开时显示一个消息框似乎会导致此行为。

It appears that displaying a message box while a form is open will cause this behaviour.

我尝试使用该消息显示第二个自定义表单而不是消息框但得到相同的结果。

I've tried displaying a second custom form with the message instead of the message box but get the same result.

我是否 表单关闭时需要以某种方式重新聚焦回Excel应用程序?

Do I  need to somehow refocus back to the Excel application when the form closes?

谢谢

推荐答案

您是否尝试过范围获得焦点
have you tried to make a range get focus


这篇关于在窗体打开时显示消息框将在窗体关闭时最小化Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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