![]() |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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
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
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
|
|
#3
|
|||
|
|||
|
Thank you, this is great.
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
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 |