vba 是什么导致 Excel 宏中的 MS VB 运行时错误 -2147417848 (80010108)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3100952/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 10:34:50  来源:igfitidea点击:

What causes MS VB Run-time Error -2147417848 (80010108) in Excel Macro

excelvbaruntime

提问by Raja

I have a macro which runs fine on my machine but when I try to run it on another machine it gives the following error.

我有一个宏,它在我的机器上运行良好,但是当我尝试在另一台机器上运行它时,它会出现以下错误。

Microsoft Visual Basic

微软 Visual Basic

Run-time Error -2147417848 (80010108)
Automation Error
The Object invoked has disconnected from its clients.

运行时错误 -2147417848 (80010108)
自动化错误
调用的对象已与其客户端断开连接。

回答by RobertOnStacko

I found that the error is caused by 'Freeze Panes'. If you are in the sliding part of the panel you get the crash, if you are in the frozen bit everything works fine. The solution is: first change the active cell to a cell in the frozen pane, e.g. Range("A1").Activate

我发现错误是由“冻结窗格”引起的。如果您处于面板的滑动部分,则会发生崩溃,如果您处于冻结位,则一切正常。解决方法是:首先将活动单元格改为冻结窗格中的单元格,例如Range("A1").Activate

回答by Icode4food

Hereis a possible solution. I haven't encountered the error myself so I'm not sure so...

是一个可能的解决方案。我自己没有遇到过这个错误,所以我不确定......

Also, more detail would be helpful, what is the code surround the line where it errors? What is the code doing? Are both machines running the same version of Windows and Excel?

此外,更多细节会有所帮助,围绕错误行的代码是什么?代码在做什么?两台机器是否运行相同版本的 Windows 和 Excel?