+ Reply to Thread
Results 1 to 11 of 11

Update closed workbooks & check if already open

  1. #1
    Registered User
    Join Date
    11-25-2015
    Location
    Copenhagen
    MS-Off Ver
    2010
    Posts
    26

    Update closed workbooks & check if already open

    Hi

    I've entered the below code in my workbook, and it's working perfectly. However I hadn't considered that some of the files that the code opens, update and save could already be open by another user on the network.

    But I can't figure out how to adjust my code so it doesn't update already opened files? And at the same time I would like a msgbox so popup and tell the user that, file XXX hasn't been updated.

    Is this possible?

    Please Login or Register  to view this content.
    I appreciate all the help I can get

    Thanks

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Update closed workbooks & check if already open

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your own requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    11-25-2015
    Location
    Copenhagen
    MS-Off Ver
    2010
    Posts
    26

    Re: Update closed workbooks & check if already open

    Hi Greg

    It's really nice code, and it's almost working.

    But when a file is open by another user, this code still opens the file, just in a "write protected" version and opens the "save as" menu. Which I have to close before your code finish.

    Do you know how to avoid that?

    I really appreciate the help

  4. #4
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Update closed workbooks & check if already open

    true adding in
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-25-2015
    Location
    Copenhagen
    MS-Off Ver
    2010
    Posts
    26

    Re: Update closed workbooks & check if already open

    That doesn't change anything.,

    I guess I need some sort of code here:


    Please Login or Register  to view this content.
    That just closes the workbook again?

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Update closed workbooks & check if already open

    Hi again,

    Sorry about that - trying to test a solution in a "simulated" environment sometimes allows glitches to pass unnoticed.

    See if the following version works for you:

    Please Login or Register  to view this content.
    Hope this helps - as before, please let me know how you get on.

    Regards,

    Greg M

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Update closed workbooks & check if already open

    Hi again,

    If the above proposal works for you, it might be more efficient to store the names of the already opened workbooks and display them in a single list at the end of the process rather than continually interrupting the process with individual messages.

    I can implement this for you if you wish.

    Regards,

    Greg M

  8. #8
    Registered User
    Join Date
    11-25-2015
    Location
    Copenhagen
    MS-Off Ver
    2010
    Posts
    26

    Re: Update closed workbooks & check if already open

    Hi Greg

    This works perfectly!!!! Just what I wanted... Thanks alot..

    Sure if possible it wouldn't hurt to have a single list at the end, so if you have time, I would like that.

  9. #9
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Update closed workbooks & check if already open

    Hi again,

    Many thanks for your feedback and also for the Reputation increase - much appreciated!

    Your wish is my command!

    See if the following code does what you need:

    Please Login or Register  to view this content.

    As before, please let me know how you get on.

    Regards,

    Greg M

  10. #10
    Registered User
    Join Date
    11-25-2015
    Location
    Copenhagen
    MS-Off Ver
    2010
    Posts
    26

    Re: Update closed workbooks & check if already open

    Hi Greg

    yet again you've done it!

    It works perfectly

    Thank you so much for your help.

  11. #11
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Update closed workbooks & check if already open

    Hi again,

    Many thanks for your feedback - I'm very pleased that I was able to help.

    Best regards,

    Greg M

+ 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. VBA export sheets from open workbook to closed workbooks
    By wannabeexcelguy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-03-2015, 10:18 AM
  2. Macro to get values from multiple closed workbooks into single open workbook
    By aman2059 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-10-2015, 08:36 AM
  3. I wnat to update closed wrkbook with our open it .is this can you please help.
    By softsandesh in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-29-2014, 07:49 AM
  4. [SOLVED] Open workbooks update the main one and close the other workbooks
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2013, 07:12 AM
  5. Check if file is open and open if closed
    By Jockster in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-22-2010, 08:18 AM
  6. check if condition is true in closed workbooks
    By aravindhan_31 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2009, 03:29 PM
  7. Sumproduct wont update properly on closed workbooks
    By vane0326 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-17-2006, 10:26 AM

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