The following routine quickly check that a string contains a valid GUID. Of course, it doesn’t check that the GUID refers to a valid entity, but at least it lets you quickly reject invalid values:
Function CheckGUID(Value As String) As Boolean Const PatternGUID = "{########-####-####-####-############}" CheckGUID = UCase$(Value) Like Replace(PatternGUID, "#", "[0-9,A-F]") End Function