Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Possible to generate a GUID in Excel?

Is there an easy way to create a GUID in Excel? (Is there a Microsoft
library I can call, or do I have to write my own?)

Any help is appreciated...
thanks, Dan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Possible to generate a GUID in Excel?

Dan,

You can call the CoCreateGuid API function to create a GUID. For
example,

Declare Function CoCreateGuid Lib "ole32" (ByRef GUID As Byte) As
Long

Sub AAA()
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
Debug.Print GUID
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Dan" wrote in message
...
Is there an easy way to create a GUID in Excel? (Is there a

Microsoft
library I can call, or do I have to write my own?)

Any help is appreciated...
thanks, Dan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Possible to generate a GUID in Excel?

ahhh, yes, I should have known that! Thanks!
dan

"Chip Pearson" wrote in message
...
Dan,

You can call the CoCreateGuid API function to create a GUID. For
example,

Declare Function CoCreateGuid Lib "ole32" (ByRef GUID As Byte) As
Long

Sub AAA()
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
Debug.Print GUID
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Dan" wrote in message
...
Is there an easy way to create a GUID in Excel? (Is there a

Microsoft
library I can call, or do I have to write my own?)

Any help is appreciated...
thanks, Dan






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate powerset in Excel? Greg Lovern Excel Discussion (Misc queries) 2 October 26th 09 04:03 PM
To generate Numbers in Excel Sonal Excel Worksheet Functions 3 June 13th 08 09:28 AM
Create A GUID Derek Hart Excel Worksheet Functions 3 December 24th 07 01:30 AM
Using Excel to generate schedules Carla Excel Discussion (Misc queries) 1 October 20th 07 09:21 AM
generate a random number and use if function to generate new data Dogdoc1142 Excel Worksheet Functions 4 April 26th 06 03:44 AM


All times are GMT +1. The time now is 08:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"