我在一台电脑上收到VBA的类型不匹配错误,但是其他错误。为什么? [英] I receive a type-mismatch error from VBA on one computer, but not on others. Why?

查看:225
本文介绍了我在一台电脑上收到VBA的类型不匹配错误,但是其他错误。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有宏的Excel文件。在这个文件中,有一个用户表单。在表单中,有一个文本框。我调用用户窗体MyForm和TextBoxMyTextBox。



我也有一个模块。在这个模块中有一个这样的子程序

  Sub MySub(s As String)
MyForm.MyTextBox.Value = s
...
End Sub

在大多数计算机上,上面的代码没有问题,而在一台计算机上,它引起类型不匹配错误。你能解释一下吗?



请帮助我。我非常乐观。



非常感谢提前,



Haris

解决方案

有些事情你可以检查(大部分是明显的,我知道)。



各种PC之间的电子表格。

- 问题PC上的文化

- 问题PC上的数据

- 与其他表单/宏一起使用的表单谁也有一个定义为s的变量



通常在文本框中输入什么样的数据?


I have an Excel file with macro. In this file, there is a user form. In the form, there is a Textbox. I call the user form "MyForm" and the TextBox "MyTextBox".

I also have a module. In this module there is a subroutine like this

Sub MySub(s As String)
    MyForm.MyTextBox.Value = s
    ...
End Sub

On most computers, the code above has no problem, while on one computer, it raises the type mismatch error. Can you explain this?

Please help me. I'm very frustated.

Many thanks in advance,

Haris

解决方案

Some things you could check (most of them obvious, I know).

-Versions of the spreadsheet between the various PCs.
-Culture on the problem PC
-Data on the problem PC
-The form being used with other forms/macros who also have a variable defined as "s"

What kind of data is usually entered into the textbox?

这篇关于我在一台电脑上收到VBA的类型不匹配错误,但是其他错误。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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