Application.ProductCode

  • Thread starter Thread starter John
  • Start date Start date
J

John

Is Application.ProductCode unique to each Excel licence?
Can it be used to prevent an application developed for one
PC being run on someone else's? What is the structure of
Application Product code - if it is unique what portion of
it is unique - e.g. can the last x characters be used?
If not product code, is there some other field which would
be unique?
Thanks in advance.
 
Hi John,

Application.ProductCode is a GUID that identifies a particular version
and build of Microsoft Office. For any given version and build it will be
the same for everyone.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Hello Rob,
Thanks for your reply. Is there any way to identify a PC
or Excel license uniquely to prevent others from using
your application? I thought of username but this is not
mandatory and can be changed at any time.
 
Hi John,

The simplest way I've found is to lock the application to the serial
number of the hard disk on which it was installed. Here's a function that
will return the disk serial number for you. Note that it assumes the
workbook is being run from a local or mapped drive.

Declare Function GetVolumeInformationA Lib "kernel32" _
(ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Long, _
ByRef lpVolumeSerialNumber As Long, _
ByRef lpMaximumComponentLength As Long, _
ByRef lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long

Public Function lGetDiskSerialNunber() As Long

Dim lSerialNum As Long
Dim lMaxCompLen As Long
Dim lFileSysFlags As Long
Dim szRoot As String
Dim szVolName As String
Dim szFileSysName As String

szRoot = Left$(ThisWorkbook.Path, 1) & ":\"
szVolName = String$(256, vbNullChar)
szFileSysName = String$(256, vbNullChar)

GetVolumeInformationA szRoot, szVolName, _
256, lSerialNum, lMaxCompLen, _
lFileSysFlags, szFileSysName, 256

lGetDiskSerialNunber = lSerialNum

End Function

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top