However if you can lock your workbook with the existing hardware of the machine , you will not need external hardware dongles.
if you use following Excel function to get Mother Board Serial Number, you can compare the current machines mother board serial number with the desired one. If you know that the desired serial number does not match with current machine you know that there is security voilation and you can close the workbook through VBA. You will need to copy this code to regular VBA module of your workbook
Excel Function to Get Mother Board Serial Number
Public Function MBSerialNumber() As String Dim objs As Object Dim obj As Object Dim WMI As Object Dim sAns As String 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 & "," Next MBSerialNumber = sAns End Function |
After you have placed above function in VBA module. You will need to copy this code to ThisWorkbook section of your workbook . This is autoopen macro which compares the MBSerialNumber of current machine with the desired MBSerialNumber. In case it does not mactch, it will close activeworkbook.
Private Sub Workbook_Open() Set RMBSN = Sheets(1).Range("C4") ' This is whare you have already stored required MBSerialNumber If MBSerialNumber <> RMBSN Then ' Checking if current machine serial number is matching with required MsgBox ("Data Security failier, This workbook will close") ' In case it does not match workbook will be closed ActiveWorkbook.Save ActiveWorkbook.Close End If End Sub |
Download Excel file with macro for Hardware Locking for Excel Workbooks
and try to open it on your machine and see how it works. This is locked version and you will not be able to open it on your machine.However you can down load Unlocked version of Hardware Locking for Excel Workbooks.
Be aware that sometimes this returns nothing, sometimes a single character - I have learnt this thinking I could use it a hardware locked serial number for my software.
ReplyDeleteHow to get my motherboard serial number and which line in your VB I can ammend the motherboard serial number? Your solution is very much appreciate. Thank you.
ReplyDeleteYou are the Man Yogesh. I have been using MAC address in one my Excel solution and it didnot work on few computers. Now, I have made this change to get a unique id from Mother Board. Hope this would work. Good useful info.
ReplyDeleteHey Yogesh. Richard has mentioned that this code returns only single character at times. Are you aware of any known issues that we need to take care? Would be helpful if you could share this info, so that everyone could take preventive measure in advance. :-)
Deletemy pc serial number be 1234567890 (assumed) then what will be the code
ReplyDeleteStep1.
DeleteUnhide sheet1
Step2.
Change the serial number in c4.
Step1.
DeleteUnhide sheet1
Step2.
Change the serial number in c4.
What could we use that would work both on a Mac and a PC? Since Excel is used on both, I am not sure if this solution would work on a Mac
ReplyDeleteThank You So Much Man!! Saved me!!
ReplyDeleteTEM COMO USAR UM CODIGO VBA QUE EXCLUA A PLANILHA QUANDO ELA FOR ABERTA NO BROFFICE LIBRE? OFFICE LIBRE DO BRAZIL...
ReplyDeletehi how do i get the MBSerial number?
ReplyDeleteOoh, this is the thing which I was looking for as I have faced these issues when I transferred some files from my old pc to new one they all got locked. And I have sold the old PC before checking the files. And all of my coursework got lost before submitting it. But at that time, custom Coursework Help online saved me. And I got the professionally written coursework before submission.
ReplyDeletejordan 4
ReplyDeletejordan retro
jordan shoes
golden goose
hermes
yeezy
lebron james shoes
jordan shoes
pg 4
westbrook shoes
Well, I was looking for this solution as I already faced this issue. My all dissertation files got locked. Then my friend told me at that time to buy dissertation online . In this way, I got a professionally written dissertation from the expert writers of the UK. But I want to know that this solution works for both Mac and PC?
ReplyDeleteWell, thanks for sharing the solution for hardware locking excel workbooks. I accidentally locked some of my phd dissertation writing service files and couldn't get help from anywhere. I want to submit my dissertation files on time. I hope this solution will work for me.
ReplyDeletewell, I just like your blog good to know about your experience of that we are giving networking service, managed IT, CCTV, security camera installation, software development web mobile app development in Canada commercial camera installations
ReplyDeleteHi
ReplyDeletePlease mail me 007.shobhit@gmail.com, need some help
TIA
Shobhit Gupta
We as a whole realize that toys are to be delighted in to the fullest for that reason it is generally commonsense to set solid and sturdy kinds of barbie dream house toys up for you to set aside cash today as well as for what's in store.
ReplyDeleteYou explained problem people face with excel really nicely. Take my online class.
ReplyDeleteThanks for writing this quality informational content. It contains very helpful and unique informationontent. It contains very helpful and unique information. We frequently want our workbook to be locked to a specific machine. I appreciate your effort in this article. Now it's time to get Live Chat Services for more information.
ReplyDeleteThank you so much for sharing all this wonderful info I appreciate your hard work and skills https://www.animationliberty.com
ReplyDeleteThanks for writing this quality informational content. I appreciate your great work and amazing idea. I get inspired by the writing skills of the writer. Keep sharing more information about this article. Now it's time to get Roofing Services in Wayne for more information.
ReplyDelete