×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VB function to find MS-Excel Product ID
3

VB function to find MS-Excel Product ID

RE: VB function to find MS-Excel Product ID

Is that possible?, I know Excel to be a part of Office Kit and you have one licence for the whole kit. They would put the number next to the barcodes in the cover of the disks.

RE: VB function to find MS-Excel Product ID

(OP)
IJR,
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

2
I have looked for this before and have come up dry. If you find it, please post it here.

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

Three ways I know::::::

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

RAY72:

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

Ray72:
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

does any know how to call function in asp

RE: VB function to find MS-Excel Product ID

I am Sanjay Masawan from Silverline Technologies Ltd.
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

Sanjay:

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

Here's another way to see MS Excel Product ID:
msgbox Application.ProductCode

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close