It's a known bug in the Scriptlet.TypeLib
object. The Guid
property should be 38 characters long, but comes back with a length of 40 with 2 garbage characters at the end. You need to trim the Guid
value to avoid the issue:
Function CreateGUID()
CreateGUID = ""
Set objTypeLib = CreateObject("Scriptlet.TypeLib")
CreateGUID = Left(TypeLib.Guid, 38) ' With curly braces: {47BC69BD-06A5-4617-B730-B644DBCD40A9}
' CreateGUID = Mid(TypeLib.Guid, 2, 36) ' Without curly braces: 47BC69BD-06A5-4617-B730-B644DBCD40A9
End Function