您可以在Excel 2007中创建唯一标识符。我正在寻找由SQL Server函数newid()生成的相同值。
由于
答案 0 :(得分:3)
您可以使用CoCreateGuid API函数
Declare Function CoCreateGuid Lib "ole32" (ByRef GUID As Byte) As Long
Public Function CreateGUID()
Dim ID(0 To 15) As Byte
Dim N As Long
Dim GUID As String
Dim Res As Long
Res = CoCreateGuid(ID(0))
For N = 0 To 15
GUID = GUID & IIf(ID(N) < 16, "0", "") & Hex$(ID(N))
Next N
CreateGUID = GUID
End Function