现在试图在我通过互联网找到的 Excel 2011 for Mac 中实现 VBA 模块。以下模块在您看到的第三行失败As String
:
Option Explicit
Public Function MD5Hash( _
ByVal strText As String) _
As String
' Create and return MD5 signature from strText.
' Signature has a length of 32 characters.
'
' 2005-11-21. Cactus Data ApS, CPH.
Dim cMD5 As New clsMD5
Dim strSignature As String
' Calculate MD5 hash.
strSignature = cMD5.MD5(strText)
' Return MD5 signature.
MD5Hash = strSignature
Set cMD5 = Nothing
End Function
Public Function IsMD5( _
ByVal strText As String, _
ByVal strMD5 As String) _
As Boolean
' Checks if strMD5 is the MD5 signature of strText.
' Returns True if they match.
' Note: strText is case sensitive while strMD5 is not.
'
' 2005-11-21. Cactus Data ApS, CPH.
Dim booMatch As Boolean
booMatch = (StrComp(strMD5, MD5Hash(strText), vbTextCompare) = 0)
IsMD5 = booMatch
End Function
希望有人可以帮忙,因为这是我第一次玩 VBA。感谢帮助!
更新
错误消息文本:
未定义用户定义类型