Hi Friends
I need a help from you please.
one of excel document contain confidential information. So that, this file should not work any other computer except my computer. Is there any way to prevent run macro from other computer?
Thanks![]()
Hi Friends
I need a help from you please.
one of excel document contain confidential information. So that, this file should not work any other computer except my computer. Is there any way to prevent run macro from other computer?
Thanks![]()
Technically it's not possible as such, but you can 'protect' your sheet to a certain extend.
a) Protect your VBA code through Tools -> VBAProject Properties -> Protection
b) Set up a splash screen to force people to enable macros.
Name a sheet "splash" and have it say "Please enable content to continue"
Then, in your WORKBOOKcode area, add the following:
That will ensure the user gets to see only the 'enable macros' sheet upon start.![]()
Please Login or Register to view this content.
Then to prevent unwanted people to open put this also in the WORKBOOK code area:
Make sure you at least put your windows logon name in the part with 'username1,username2,username3' etc - this is where you put the windows login names of the people you want to have access. Not sure what yours exactly is, go to the immediate code area (control+G in the VBA area) and type 'debug.print environ("username")'
Any username that is not in the 'allowed list', will result in the workbook auto-closing.![]()
Please Login or Register to view this content.
Enjoy
ps, instead of blocking on username, you can also use Environ("COMPUTERNAME")
Last edited by JasperD; 07-19-2015 at 01:52 AM.
Please click the * below if this helps
Hi JasperD,
Thank you very much for your quick respond.
Please solve this issue.
When I click Save button, bellow code is highlighted as an error
sht.Visible = xlSheetVeryHidden
And one more think is now i coudn't find the perticular sheet.
How can I get it back?
Thanks....![]()
did you create a sheet called 'splash' ?
What the code does is hide all sheets upon save and if there's a sheet called 'splash', the code shouldn't error
Unhide all via:
Try changing 'xlsheetveryhidden' into 'xlveryhidden', but it shouldn't matter.![]()
Please Login or Register to view this content.
Wouldn't it be possible to just add a password code snippet in the beginning of the code and then protect the code with the built in password protection. The first password could be read from another Excel file that you keep on your computer only.
<----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left
If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.
Perhaps you could put something like this in the Open event.
Excel is not secure. At all.![]()
Please Login or Register to view this content.
If you have truly sensitive data that you want protected, Excel is the wrong platform.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
I had a similar need to yours and I got around it this way. I created a small txt file (F:\AuthorizedComputer.txt) and placed it on the computer that is authorized. Then at the start of the macro you wish to check if this computer is ok to proceed place the code in the attached macro. This is just a simple way to stop unauthorized running of the macro.
![]()
Please Login or Register to view this content.
Thank you very much JasperD, Now It work. Perfect
Thank you mikerickson and Catman50.
I added your code too for further protection.
Thanks a lot for all.
I have often read about the insecurities in Excel, but I am intrigued to know how if the VBA project is password protected that "This kind of "protection" is bypassed in few seconds …". I am not being smart, I would just like to know?
So many tricks around the net ! Either by code or simple manipulation …
Excel 2013 version is better protected but recently I saw a society sales on net a tool to break it !
So for very sensitive data, just avoid Excel !
Duplicate …
Hi janagan,
Though Excel is not secure, just to answer your question you could check the machine name that the code is being opened from and if it's not equal to yours end it, which would be something like this:
Regards,![]()
Please Login or Register to view this content.
Robert
____________________________________________
Please ensure you mark your thread as Solved once it is. Click here to see how
If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post
@Marc L, 2013 VBA protection is no better than earlier versions. I believe that the additional protection is related to Password to open and Encrypting the workbook
Thanks Kyle123 !
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks