I created a Macro to do some copying and pasting. Can I restrict that Macro so that it can only be used from my PC?
I created a Macro to do some copying and pasting. Can I restrict that Macro so that it can only be used from my PC?
Last edited by Pedroluna; 04-06-2009 at 12:22 PM.
You can but why would it be necessary? You would need to add code to obtain something unique like the hard drive serial number or possibly the computer name.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
The macro copies information into (sensitive) files read by Management. I could create a separte macro file and place it in my hard drive but then it would not be back up. I mostly want to keep others from changing/running the Macro. I tried restricting the file but it does keep others from running it only changing it. I can keep others from opening the file altogehter by password protecting it. Short of that what are my alternitives?
You could keep your macro in Personal.xls, which you can (and should) back up periodically. My Personal.xls includes this:
I run it each time I add or delete something.Please Login or Register to view this content.
Entia non sunt multiplicanda sine necessitate
You could get your computer name & then write code to check the PC running the code against the name of your PC. If it is different then stop the code.
This will get your PC' name
Once you know the name thenPlease Login or Register to view this content.
Please Login or Register to view this content.
I like the last code w/If Environ("COMPUTERNAME") <> MyPc Then Exit Sub.
I tried it and works great.
Thanks,
Just a caution: It would take someone about five seconds to change their computer name and run the sub.
Checking the drive serial number would be much more secure. And either way, you need to protect the VBA project.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks