Hello Excel Experts,
I really in need in your urgent help. I would truly appreciate any pointers or and any help with this code to that will be used to prevent a worksheet/workbook from being copied (shout out to yaseensallam for the code).
#using Excel 2013
This code now works for a single computer, however i would like to add more computer's into the code. How do add in an array or somewhere in those lines to make a list of computers which i can and/delete in future?
Thank you so much in advance for taking the time to help me with this. I really x 10000 appreciate it.
regards.,
I really in need in your urgent help. I would truly appreciate any pointers or and any help with this code to that will be used to prevent a worksheet/workbook from being copied (shout out to yaseensallam for the code).
#using Excel 2013
This code now works for a single computer, however i would like to add more computer's into the code. How do add in an array or somewhere in those lines to make a list of computers which i can and/delete in future?
HTML:
Private Sub GetSerialNumber()Dim obj As ObjectDim WMI As ObjectDim sAns As StringDim ss As StringDim kk As StringSet WMI = GetObject("WinMgmts:")Set objs = WMI.InstancesOf("Win32_BaseBoard")For Each obj In objs sAns = sAns & obj.SerialNumber If sAns < objs.Count Then sAns = sAns & ","Next'GetSerialNumber = sAnsSheets("sheet1").Range("A9") = sAnsEnd Sub
HTML:
Private Sub GetSerialNumberProtection()Dim obj As ObjectDim WMI As ObjectDim sAns As StringDim ss As StringDim kk As StringApplication.DisplayAlerts = Falsess = ".YOURMACHINENAME. ,"Set WMI = GetObject("WinMgmts:")Set objs = WMI.InstancesOf("Win32_BaseBoard")For Each obj In objs sAns = sAns & obj.SerialNumber If sAns < objs.Count Then sAns = sAns & ","Nextkk = sAns If kk <> ss ThenDim answer As IntegerMsgBox "Program Need Maintenance Code 001 .", vbOKOnlyActiveWorkbook.SaveAs FileFormat:=50, Password:="Gordy", WriteResPassword:="", _ReadOnlyRecommended:=False, CreateBackup:=FalseApplication.DisplayAlerts = TrueApplication.QuitEnd If' file format numbers on https://msdn.microsoft.com/en-us/vba...meration-excel'FileFormat:=xlNormal = 56End Sub
HTML:
Private Sub Workbook_Open()Application.ScreenUpdating = False Run "GetSerialNumberProtection" Application.ScreenUpdating = TrueEnd Sub
Thank you so much in advance for taking the time to help me with this. I really x 10000 appreciate it.
regards.,