Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    milton keynes, Buckinghamshire
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File opening (2003)

    On Error GoTo ErrorNoAcctsFile
    Workbooks.Open AcctsFileAddress, UpdateLinks:=False
    On Error GoTo 0

    The above code opens an accounts file that resides on the network. I need to amend the code so that will only open the file if it is not already in use by another user. If the file is already in use by someone else the code needs to return the message "Accounts file in use please retry later."

    Can anybody please assist with a code extract.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: File opening (2003)

    You can use the IsFileOpen function from <post:=158,682>post 158,682</post:> to check whether the workbook is already in use. If so, display a message box, otherwise open the workbook.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    milton keynes, Buckinghamshire
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File opening (2003)

    Thanks, this has resolved the issue

  4. #4
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    milton keynes, Buckinghamshire
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File opening (2003)

    Can you please advise how to return the name of the current user of that file, if you open an excel file that is currently in use

    Thanks

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: File opening (2003)


Posting Permissions

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