Land Of Oorang

Or "Things Only I Will Think Are Important"

Blog

A Simple Way to Get a GUID

Posted by Oorang on June 28, 2009 at 7:41 AM

I have seen a lot of different ways to get a GUID, from randomly generating each character to using API calls. And every time I do, I think "Gosh that didn't have to be so hard." So for the record... Here is the easy way:

Private Function GetGUID() As String
GetGUID = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2, 36)
End Function

Of course if you only need one, you could just go here.

Categories: VBA, Strings

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

1 Comment

Reply Not Oorang
08:20 AM on June 28, 2009 
Test