+ Reply to Thread
Results 1 to 2 of 2

Test User before saving a file.

  1. #1
    Steven
    Guest

    Test User before saving a file.

    What I want to do is put code in the ThisWorkbook...Before Save. My
    ultimate goal is to test the user and not allow other users to save the file.
    I need for others to view the file but I dont want them to be able to save
    it. Also, I dont want to password the file because then I have to input a
    password every time. Is there a way to in Before Save say something like:

    ReturnNetworkName = Environ("UserName")
    If ReturnNetworkName = "TheCorrectID" Then
    ...allow save
    Else
    MsgBox "You are not the authorized user to save this file."
    Endif

    Thank you for your help.

    Steven




  2. #2
    Jim Thomlinson
    Guest

    RE: Test User before saving a file.

    Before save has a cancel argument. Use the code you have and set the cancel
    argument as is appropriate. You will probably want to use a function to
    determine if the username is in your list of allowable user names...
    --
    HTH...

    Jim Thomlinson


    "Steven" wrote:

    > What I want to do is put code in the ThisWorkbook...Before Save. My
    > ultimate goal is to test the user and not allow other users to save the file.
    > I need for others to view the file but I dont want them to be able to save
    > it. Also, I dont want to password the file because then I have to input a
    > password every time. Is there a way to in Before Save say something like:
    >
    > ReturnNetworkName = Environ("UserName")
    > If ReturnNetworkName = "TheCorrectID" Then
    > ...allow save
    > Else
    > MsgBox "You are not the authorized user to save this file."
    > Endif
    >
    > Thank you for your help.
    >
    > Steven
    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1