Source code recommendation: VB's GUID generation algorithm
'RETURNS: GUID if successful; blank string otherwise.'Unlike the GUIDS in the registry, this function returns GUID'without "-" characters See comments for how to modify if you'want the dash.Public Function GUID () As String. Dim lRetVal As Long Dim udtGuid As GUID Dim sPartOne As String Dim sPartTwo As String Dim sPartThree As String Dim sPartFour As String Dim iDataLen As Integer Dim iStrLen As Integer Dim iCtr As Integer Dim sAns As String On Error GoTo errorhandler sAns = "" lRetVal = CocreateGuid (UDTGUID) if Lretval = 0 Then 'First 8 Chars Spartone = HEX $ (UDTGUID.PARTONE) ISTRLEN = LEN (spartone) iDatalen = LEN (UDTGUID.PARTONE) Spartone = String ((iDatalen * 2) - Istrlen, "0 ") _ & Trim $ (spartone) 'Next 4 Chars sparttwo = hex $ (udtguid.parttwo) istrlen = len (sparttwo) iDatalen = len (udtguid.parttwo) sparttwo = string ((iDatalen * 2) - Istrlen, "0") _ & Trim $ (sPartTwo) 'Next 4 Chars sPartThree = Hex $ (udtGuid.PartThree) iStrLen = Len (sPartThree) iDataLen = Len (udtGuid.PartThree) sPartThree = String ((iDataLen * 2) - iStrLen, "0") _ & trim $ (spartthree) 'Next 2 Bytes (4 hex digits)' final 16 chars for ictr = 0 to 7 spartfour = spartfour & _ format $ (HEX $ (udtguid.partfour (ictr)), " 00 ") Next 'to create Guid with" - "-", Change Line Below TO:' SANS = Spartone & "-" &