Temat: Generacja GUID w ArcGIS
Nie trzeba, sam się wsadza (generuje się już pomiędzy {}) ;P
To kod MVB do wprowadzenia w Excelu:
'Written: October 12, 2009
'Author: Leith Ross
'Summary: Function creates a GUID (aka CLSID) and returns it as a string.
Private Type GUID
Data1 As Long
Data2 As Long
Data3 As Long
Data4(8) As Byte
End Type
Private Declare Function CoCreateGuid _
Lib "ole32.dll" _
(ByRef pGUID As GUID) As Long
Private Declare Function StringFromGUID2 _
Lib "ole32.dll" _
(ByRef rGUID As Any, _
ByVal lpstrCLSID As Long, _
ByVal cbMax As Long) As Long
Function CreateGUID() As String
Dim b() As Byte
Dim BuffSize As Long
Dim RetVal As Long
Dim MyGUID As GUID
BuffSize = 40
ReDim b(BuffSize * 2) As Byte
RetVal = CoCreateGuid(MyGUID)
RetVal = StringFromGUID2(MyGUID, VarPtr(b(0)), BuffSize)
CreateGUID = Left$(b, RetVal - 1)
End Function