Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-16-2018, 09:07 AM
allex011 allex011 is offline Excel file related to cpu and date on computer Windows 7 32bit Excel file related to cpu and date on computer Office 2007
Advanced Beginner
Excel file related to cpu and date on computer
 
Join Date: Dec 2017
Posts: 39
allex011 is on a distinguished road
Default Excel file related to cpu and date on computer

Can someone help me with an excel file(with macro) that would be related to only one pc without the possibility of switching to another pc and time limit of 30 days.
Thank in andvanced


Aleksandar
Reply With Quote
  #2  
Old 10-16-2018, 08:23 PM
Logit Logit is offline Excel file related to cpu and date on computer Windows 10 Excel file related to cpu and date on computer Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

This macro will obtain the Hard Drive serial number :

Code:
Option Explicit

Sub GetPhysicalSerial()
 
Dim obj As Object
Dim WMI As Object
 
Set WMI = GetObject("WinMgmts:")
 
For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
MsgBox "SN: " & obj.SerialNumber
Next
 
End Sub
This code is for a Visual Basic Script file. It obtains the machine serial number.

Code:
 strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery( _
    "SELECT * FROM Win32_ComputerSystemProduct") 
For Each objItem in colItems 
    msgbox "This Device: " & objItem.IdentifyingNumber, vbOkayOnly, "Serial Number"
Next
Paste the code into NOTEPAD, then save it as Serial Number.vbs

If you are sending your project to a customer, you can send the customer both of these files first. Request the customer run the files and send you the information that is obtained. Then you can utilize that information in your macro code to verify it is running on the correct machine. You would do this the same way as you would be checking for a password.

This macro will time limit the use of the workbook, advising the user how many days they have left before it expires.

Code:
Option Explicit

Sub EndSplash()
    Dim exdate As Date
    UserForm1.Hide
    exdate = "11/27/2018"      '<---- Uncomment and add expire date !!!!!!!!!!!!!!!
    If Date > exdate Then
        MsgBox ("End of your trail period! Contact to Theikdi Maung")
        ActiveWorkbook.Close
    End If
    MsgBox ("You have " & exdate - Date & " Days left")
End Sub
The attached file is the sample workbook for you to review.
Attached Files
File Type: xlsm Time Bomb.xlsm (23.8 KB, 13 views)
Reply With Quote
  #3  
Old 10-22-2018, 03:17 PM
allex011 allex011 is offline Excel file related to cpu and date on computer Windows 7 32bit Excel file related to cpu and date on computer Office 2007
Advanced Beginner
Excel file related to cpu and date on computer
 
Join Date: Dec 2017
Posts: 39
allex011 is on a distinguished road
Default

Thank you, this is great.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel file related to cpu and date on computer HELP! Computer crashed, no recovery file, old versions, etc and file was open for over 24 hours! matthew.coppedge Word 2 04-07-2016 09:01 PM
Please answer my question related to MS Excel 2007. Part 6. MonkiaSaini Excel 1 05-30-2010 12:02 PM
Please answer my question related to MS Excel 2007. Part 4. MonkiaSaini Excel 0 05-09-2010 04:19 AM
Please answer my question related to MS Excel 2007. Part 3. MonkiaSaini Excel 0 05-09-2010 04:17 AM
Please answer my question related to MS Excel 2007. Part 2. MonkiaSaini Excel 0 05-09-2010 04:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft