Excel中的VBA - 我正在尝试将自定义数据类型发送到这样的子类:
Public Type emailBody
emailAddress As String
End Type
Sub SendEmail(email As emailBody)
Dim queryString as String
queryString = "email=" & email.emailAddress
'email sending code goes here
End Sub
在我的表格中:
Private Type emailBody
emailAddress As String
End Type
Private Sub sendemail_Click()
Dim emailFields as emailBody
Dim emailAddress As String
emailFields.emailAddress = "myemail@example.com"
Call SendEmail(emailFields)
End Sub
我收到此错误:
ByRef argument type mismatch
在这一行:
Call SendEmail(emailFields)
来自javascript和PHP背景,所以不确定是什么引发了这个错误或者我错过了什么。