Excel错误 - 无法将焦点移动到控件,因为它是不可见的,未启用或不接受焦点的类型 [英] Excel error - Can't move focus to the control because it is invisible, not enabled or of a type that does not accept the focus

查看:243
本文介绍了Excel错误 - 无法将焦点移动到控件,因为它是不可见的,未启用或不接受焦点的类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想解决的错误是"无法将焦点移动到控件上,因为它是不可见的,未启用或者不接受焦点的类型"对于每月发送给数百名用户的.xlsm Excel 2010电子表格,填写
然后通过电子邮件发回给我们。其中一个用户当他们单击触发宏的按钮时会出现此错误,该宏使用ActiveWorkbook.SendMail函数将工作簿发送给我。


我找到了一种强制修复的方法,http://social.msdn.microsoft.com/Forums/office/en-US/3263b079- 7e4f-452C-8dcc-92c682b8370b-因为-IT-是不可见 - 不启用Excel的形状倾斜,移动焦点到的 - 控制 - 或对的一型的是/?论坛= exceldev。
但是我在电子表格中没有ActiveX控件,用户运行的宏不启用任何表单或控件。有几个MsgBox,例如MsgBox(提示:="Something"Title:="Something else")。


任何帮助表示赞赏。


干杯

解决方案


欢迎光临到MSDN论坛。


>>其中一个用户在单击触发宏的按钮时会收到此错误<<


按钮在哪里?它是工作簿中的ActiveX控件吗?


根据您的描述,我假设工作表中有一个命令按钮。


我做了一个为你测试。


我创建了一个带有命令按钮的工作簿编写代码如下:

 Private Sub CommandButton1_Click()
ActiveWorkbook.SendMail Recipients:=" xxx@xxx.com" ;
End Sub

运行代码后,工作簿将被发送给收件人。


< img alt =""src ="http://social.msdn.microsoft.com/Forums/getfile/397487">


收件人收到电子邮件后,保存为并打开工作簿,他无法重现这个问题。


我建议您在worksheet.Activate事件中调试,以查看命令按钮的Enabled和Visible属性。


如果我误解了,你能否给我一个可行的样本或帮我重现这个问题?


另外,>>其中一个用户收到此错误<<

是否只有一个用户收到错误?

如果是,他的环境和其他人之间是否有任何不同。

Hi all,

The error I am trying to solve is "Can't move focus to the control because it is invisible, not enabled or of a type that does not accept the focus" for a .xlsm Excel 2010 spreadsheet that is sent out to hundreds of users each month, filled in then emailed back to us. One of the users gets this error when they click a button that triggers a macro which uses the ActiveWorkbook.SendMail function to email the workbook back to me.

I have found this description of a way of forcing a fix, http://social.msdn.microsoft.com/Forums/office/en-US/3263b079-7e4f-452c-8dcc-92c682b8370b/excel-form-cant-move-focus-to-the-control-because-it-is-invisible-not-enabled-or-of-a-type-that?forum=exceldev. However I have no ActiveX Controls in the spreadsheet and the macro the user runs does not enable any forms or controls. There are several MsgBox's such as MsgBox (Prompt := "Something" Title := "Something else").

Any help is appreciated.

Cheers

解决方案

Hi,

Welcome to MSDN forum.

>> One of the users gets this error when they click a button that triggers a macro <<

Where is the button? Is it an ActiveX control in the workbook?

According to your description, I assume there is a command button in the worksheet.

I made a test for you.

I created a workbook with a command button and write code as follows:

Private Sub CommandButton1_Click()
    ActiveWorkbook.SendMail Recipients:="xxx@xxx.com"
End Sub

After running the code, the workbook would be sent to the recipient.

After the recipient received the email, saved as and opened the workbook, he couldn’t reproduce the issue.

I suggest you debugging in worksheet.Activate event to take a look at the Enabled and Visible properties of the command button.

If I misunderstood, could you please give me a workable sample or help me to reproduce the issue?

In addition, >> One of the users gets this error <<
Is there only one user getting the error?
If yes, Is there anything different between his environment and others.


这篇关于Excel错误 - 无法将焦点移动到控件,因为它是不可见的,未启用或不接受焦点的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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