VB function to find MS-Excel Product ID
VB function to find MS-Excel Product ID
(OP)
Does any one know how to "get" MS-Excel's PRoduct ID i.e the serial number of the licence.
Thanx
Narendranath R
narenr@narendranath.itgo.com
http://www.narendranath.itgo.com
Pipeline engineering is made easy with state of the art computer software, visit www.narendranath.itgo.com.
Thanx
Narendranath R
narenr@narendranath.itgo.com
http://www.narendranath.itgo.com
Pipeline engineering is made easy with state of the art computer software, visit www.narendranath.itgo.com.
RE: VB function to find MS-Excel Product ID
RE: VB function to find MS-Excel Product ID
I think it should be possible to get the MS-Excel product ID [licence #] through visual basic code.
I am trying to read the excel product ID # to write a encryption program to limit the use of a particular program to a predetermined excel licence.
Narendranath R
narenr@narendranath.itgo.com
http://www.narendranath.itgo.com
Pipeline engineering is made easy with state of the art computer software, visit www.narendranath.itgo.com.
RE: VB function to find MS-Excel Product ID
Could you make it machine specific? I can give you code that will get the machine serial number. In addition, if using NT, you can also get the login name.
Let me know.
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: VB function to find MS-Excel Product ID
open up excel, while its opening the # appears.
After you have excel open, you can open up help, about excel you will see the #.
you can open "regedit" under the run button, proceed down HKEY_LOCAL_MACHINE....software....HKEY_LOCAL_MACHINE\Software\Microsoft\MS Office 97 Professional....registration....click on registration and look on the right side...you will see all the info you need
RE: VB function to find MS-Excel Product ID
This is not necessarily true. Depending on your installation, this information may not be present, let alone in a constant key name. This makes it tough to get programatically.
narenr:
This code will get the serial number of drive "C" and report it as a long. If you use this as a standalone program, you can get the serial number for each PC you are going to allow your program to run. Then, in your main application, you can compare the value returned from the GetVolumeInformation() function to a hardcoded list of approved PCs.
Option Explicit
Declare Function GetVolumeInformation Lib "kernel32" _
Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Long, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long
Sub Main()
Dim lpRootPathName As String
Dim lpVolumeNameBuffer As String
Dim nVolumeNameSize As Long
Dim lpVolumeSerialNumber As Long
Dim lpMaximumComponentLength As Long
Dim lpFileSystemFlags As Long
Dim lpFileSystemNameBuffer As String
Dim nFileSystemNameSize As Long
Dim ReturnVal As Long
lpRootPathName = "C:\"
ReturnVal = GetVolumeInformation _
(lpRootPathName, _
lpVolumeNameBuffer, _
nVolumeNameSize, _
lpVolumeSerialNumber, _
lpMaximumComponentLength, _
lpFileSystemFlags, _
lpFileSystemNameBuffer, _
nFileSystemNameSize)
MsgBox "Serial No: " & lpVolumeSerialNumber
End Sub
NOTES: There are a couple of problems with this method. First, hardcoding serial numbers into a program is somewhat sloppy. Not too bad for a handful of systems, but not meant for wide distribution. If any of the approved PCs have their hard drive changed, you will have to recompile your program with an updated list of approved serial numbers. Putting the serial numbers in a separate file is not real secure either.
If the program is running Windows NT, you could also validate the user login ID. This code will give you the username currently logged in:
Declare Function GetUserName Lib _
"advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
nSize As Long) As Long
Sub GetUserName()
Dim lpBuff As String * 25
Dim ret As Long, UserName As String
ret = GetUserName(lpBuff, 25)
UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
UserName = UCase(UserName)
MsgBox UserName
End Sub
Hope this helps!
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: VB function to find MS-Excel Product ID
Sorry, I was only referring to the registry portion of your reply.
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: VB function to find MS-Excel Product ID
RE: VB function to find MS-Excel Product ID
I am find difficult to get some solution for this problem.
It would be very great of u if u could help me out.
I want to fetch the machine serial number(Serial of the computer which is unique) through VB or API
Please reply on sanjaym@silverline.com
Sanjay Masawan
RE: VB function to find MS-Excel Product ID
As I replied in your e-mail, the call to the GetVolumeInformation API function will return the serial number in the lpVolumeSerialNumber variable.
NOTE: The serial number is NOT necessarily unique. We ordered a bunch of PC's that all came in with the same serial number on the drive. I believe that this is because they used Ghost or DriveCopy to duplicate a formatted disk.
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: VB function to find MS-Excel Product ID
msgbox Application.ProductCode