+ Reply to Thread
Results 1 to 11 of 11

"File In Use" Message - how can this be disabled?

  1. #1
    Registered User
    Join Date
    07-20-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    11

    "File In Use" Message - how can this be disabled?

    From 1 specific excel file, I have a button which opens another excel file, however I only want it to open the other excel file if it is not already opened by someone else.

    The below code works really well, except that Excel displays a "File In Use" message which offers the user 3 options: "Readonly","Notify","Cancel".
    This message is displayed immediately after the Workbooks.Open command.
    I don't want the user to see that message, because my vba will make the decision for them.
    But how can I get excel to not show that message?

    Please Login or Register  to view this content.
    Last edited by seaside_escape; 07-22-2016 at 06:32 AM. Reason: Issue now solved

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: "File In Use" Message - how can this be disabled?

    Hi seaside,

    Welcome to the Forum!


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    07-20-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    11

    Re: "File In Use" Message - how can this be disabled?

    Thank you, I have now added the # around the code - will people be able to see my post?

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: "File In Use" Message - how can this be disabled?

    Hi seaside,

    Sure, your post is just fine now!

    And, thanks for the rep!

  5. #5
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: "File In Use" Message - how can this be disabled?

    Hi seaside,

    I have used the following on shared files.

    Please Login or Register  to view this content.
    Perhaps you could add it to your code.

    Regards

    peterrc

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,271

    Re: "File In Use" Message - how can this be disabled?

    Take a look at this one.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: "File In Use" Message - how can this be disabled?


  8. #8
    Registered User
    Join Date
    07-20-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    11

    Re: "File In Use" Message - how can this be disabled?

    Hi peterrc,
    I tried putting the workbook_open sub into the source file and I still got the "File In Use" notification when I tried opening it from another excel workbook.

  9. #9
    Registered User
    Join Date
    07-20-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    11

    Re: "File In Use" Message - how can this be disabled?

    Hi everyone,
    Thank you for your tips. I have tried them all but I'm still getting the "File In Use" notification.
    However, I have found the cause of the problem - but I'm still after any advice if you have some?

    In my excel workbook I have got an ActiveX Control Button ("Forms.CommandButton.1") which calls my vba code through the below:
    Please Login or Register  to view this content.
    This is causing excel to display the "File In Use" notification.
    If I add in a Form Control Button instead, this is assigned to the Macro directly "Submit_Assessment" and it doesn't display the "File In Use" notification.

    My problem now is how do I assign a private sub macro to a Form Control Button?

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: "File In Use" Message - how can this be disabled?

    How did you try?
    Just an example
    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: "File In Use" Message - how can this be disabled?

    Hi seaside,

    I have just tried to access one of my network files that I know is already being used by another member of staff.
    Yes, I was allowed to select "Read Only" but as soon as I did another massage pops up "File is read only and will now close" and the only option is to click "OK".
    In your first post you stated:-
    I only want to open an excel file if it is not already opened by someone else.
    The code I sent you doesn't allow them to open it if it is already opened - problem solved ?

    Regards

    peterrc

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. Replies: 7
    Last Post: 11-14-2013, 04:25 PM
  3. MSoffice Outlook 2003 message to be saved in C dir with the file name "From" "Sent" "Sub"
    By shailendra0509 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2012, 01:32 AM
  4. Transfert cell values from file "A" to file "B" skipping columns in file "B".
    By Sentrosi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2009, 11:11 PM
  5. Replies: 1
    Last Post: 03-29-2006, 09:15 AM
  6. Replies: 2
    Last Post: 10-15-2005, 10:05 AM
  7. Replies: 0
    Last Post: 10-12-2005, 12:05 PM
  8. [SOLVED] Excel sort option disabled--file name followed by "group" at top .
    By Margaret in forum Excel General
    Replies: 1
    Last Post: 04-07-2005, 12:06 PM

Tags for this Thread

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