+ Reply to Thread
Results 1 to 6 of 6

Open multiples workbooks in exact order

  1. #1
    Registered User
    Join Date
    07-09-2014
    Location
    Lisbon
    MS-Off Ver
    Microsoft Office 365 ProPlus Version 1708 (build 8431.2153)
    Posts
    62

    Question Open multiples workbooks in exact order

    Hi guys,

    So, I work with several workbooks opened at the same time on a daily basis and I'm used to work with them in a specific order (the order they are displayed in the taskbar).
    It is simple to get VBA to open them, but is there a way to open them in an exact sequence so the display order is exactly the one I want?
    I've tried to add waiting seconds between the commands, call different individual commands but nothing seams to work... they open in an apparently disorder

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Open multiples workbooks in exact order

    My task bar does not display the workbooks as the primary view, but when I hover the mouse on the Excel icon on the taskbar it shows the files in exactly the order that I opened them. I am using xl2013 and all previous versions that I have used displayed the files in the order they were opened, as well as automatically indexing them according to that same order. You can either list the workbooks in a range on a worksheet and use that list to open the files with a loop in a macro, or use an array within the macro to do the same thing. If you add or delete files, I would suggest you use the list on a worksheet method.

    Well, I went to control panel and changed my task bar so it would display the labels for each open window and it still shows the workbooks in the order that they are opened.
    Last edited by JLGWhiz; 09-12-2018 at 01:59 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Open multiples workbooks in exact order

    Hi no-Fate

    It looks like things changed in Windows 10. See if this site gets you closer to an answer.

    https://superuser.com/questions/9475...-taskbar-items

    Perhaps Jumplists are what you need to use instead?

    https://www.addictivetips.com/window...in-windows-10/
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    07-09-2014
    Location
    Lisbon
    MS-Off Ver
    Microsoft Office 365 ProPlus Version 1708 (build 8431.2153)
    Posts
    62

    Re: Open multiples workbooks in exact order

    Hi,

    Just to make things more clear, my taskbar buttons are not combined in purpose, so multiple workbooks are displayed individually:

    screenshot.JPG

    If I open them manually, one by one, as shown in the attached image, they are obviously displayed in the opened order.
    My problem is that, when trying to open them all using a VBA command, even if in the desired order, excel seams to open them randomly (I believe that the ones faster to load are opening faster, therefore breaking the desired order).

    So, is there any way to force the VBA to fully open workbook1 and only then move to workbook2 and so on?
    Thank you.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Open multiples workbooks in exact order

    Hi,

    Have you tried to put VBA in each of the individual workbooks that will open the next one in order? Is the order of opening these always the same or does it change?

    Another suggestion is to put the VBA command of "DoEvents" in your code so it will finish the Open command before moving on to the next file.

    See this site to see other possible ways of waiting for things to finish.

    https://analystcave.com/vba-sleep-vs-wait/

  6. #6
    Registered User
    Join Date
    07-09-2014
    Location
    Lisbon
    MS-Off Ver
    Microsoft Office 365 ProPlus Version 1708 (build 8431.2153)
    Posts
    62

    Re: Open multiples workbooks in exact order

    Quote Originally Posted by MarvinP View Post
    Hi,

    Have you tried to put VBA in each of the individual workbooks that will open the next one in order? Is the order of opening these always the same or does it change?

    Another suggestion is to put the VBA command of "DoEvents" in your code so it will finish the Open command before moving on to the next file.

    See this site to see other possible ways of waiting for things to finish.

    https://analystcave.com/vba-sleep-vs-wait/
    Hi Marvin,

    Thank you! This actually did the trick.
    Although, can't understand why, but I had to wrote the workbooks order upside down so it actually open them the right way... whatever. It is giving me what I need and I'm satisfied with that.

    Cheers!

+ 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. Replies: 1
    Last Post: 03-31-2016, 02:06 AM
  2. Replies: 2
    Last Post: 06-01-2015, 07:31 AM
  3. Save worksheets in exact order to a single pdf
    By loneman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-04-2014, 06:04 PM
  4. Replies: 2
    Last Post: 01-08-2014, 07:05 AM
  5. [SOLVED] Vlookup not working as multiples of given word and not exact match's.
    By oneblondebrow in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2013, 11:32 AM
  6. Why do two exact workbooks perform differently.
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-09-2011, 12:20 AM
  7. not to open the file after exact date
    By nasser in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2007, 08:05 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