Class 有一个在VBA中调用我的类中的过程的文本框
我是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
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