Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Class 有一个在VBA中调用我的类中的过程的文本框_Class_Vba_Textbox - Fatal编程技术网

Class 有一个在VBA中调用我的类中的过程的文本框

Class 有一个在VBA中调用我的类中的过程的文本框,class,vba,textbox,Class,Vba,Textbox,我是VBA和其他课程的新手。 我在班上有这样的程序: Public Sub InputData() Dim blnLoaded As Boolean Dim path As String Dim file As String path = MyForm.TextPath file = MyForm.TextFile If LoadData(path, file) = False Then MsgBox FileErrorString Else blnLoaded = L

我是VBA和其他课程的新手。 我在班上有这样的程序:

Public Sub InputData()

Dim blnLoaded As Boolean
Dim path As String
Dim file As String

path = MyForm.TextPath

file = MyForm.TextFile

If LoadData(path, file) = False Then

    MsgBox FileErrorString
Else
    blnLoaded = LoadData(path, file)
End If

End Sub
我想用我表格中的两个文本框来调用它:

Private Sub CmdLoad_Click()

Call clsData.InputData

End Sub

我做错了什么?提前谢谢你

首先需要创建类的新实例

类似的情况取决于类的实现:

Private Sub CmdLoad_Click()

  Dim myData as New clsData

  Call myData.InputData()

End Sub