none
Opening an Excel File on Specific Machines only RRS feed

  • Question

  • Hi!

    There's a specific file that we've created using excel for use of authorized people only. We wanted to ensure that the Excel file can only be opened on the machine where it was first opened. And if the user tries to open the program in another computer, they won't be able to.

    I'm a newbie VBA programmer and don't really know the best approach to do this.

    Would you guys kindly be able to give advice?

    Your help would be much appreciated!

    Thanks :)

    Sunday, March 24, 2013 11:25 AM

Answers

  • There is no foolproof way as Excel files are not designed for security. If you put protection in VBA you can open the file with the Shift key held and on open macros won't run. You can password protect the file, but there are plenty of free password cracking tools on the web for office files. So your strict answer is no.

    However you can add passwords and use VBA to read the registry or user name, but that won't stop an expert.

    Safest is to only save the file on a network and set the network security settings to restrict who can see the file.


    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Tuesday, March 26, 2013 7:28 PM

All replies

  • Hi Dtprogrammer,

    Thank you for posting in the MSDN Forum.

    As far as I know, VBA cannot be used to accomplish such kind of request. I'll move your thread to Visual Basic for Applications (VBA) Forum to see whether there are some good suggestions or not.

    Thank you for your understanding.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 26, 2013 8:10 AM
    Moderator
  • There is no foolproof way as Excel files are not designed for security. If you put protection in VBA you can open the file with the Shift key held and on open macros won't run. You can password protect the file, but there are plenty of free password cracking tools on the web for office files. So your strict answer is no.

    However you can add passwords and use VBA to read the registry or user name, but that won't stop an expert.

    Safest is to only save the file on a network and set the network security settings to restrict who can see the file.


    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Tuesday, March 26, 2013 7:28 PM