+ Reply to Thread
Results 1 to 3 of 3

Workbooks collection only returns one open workbook in Excel 2016

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    9

    Workbooks collection only returns one open workbook in Excel 2016

    Hi.

    I have a program that has been running without a hitch since Excel 2007. A user signed up to Office 365 got upgraded to Office 2016. Now the program fails when looking for a specific open workbook. Here is the code where the failure occurs:

    Please Login or Register  to view this content.
    The line
    Please Login or Register  to view this content.
    only returns a single open workbook, usually the workbook containing the code. It doesn't seem to matter how many workbooks are open, the workbooks collection only returns a single workbook. Since the workbook being looked for isn't found, the routine always returns a null object reference even though the desired workbooks is open. I tried putting "Application." before "Workbooks" in the hope that it would more specifically qualify the collection...to no avail.

    Has anyone seen this issue and, if so, was any solution found. In the research I've done so far, it appears 2016 opens new instances of Excel with each open workbook. I'm guessing they have a bug in the code that only sees open workbooks in the current instance of Excel, which is why the collection only contains a reference to the workbook containing the code.

    Hope someone can help.

    Peter

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Workbooks collection only returns one open workbook in Excel 2016

    Peter

    I use Excel 365 too and when I open mulitple workbooks they all open in the same instance though each workbook has it's own tab on the taskbar.

    In the workbook with the code what does the user see in the Project Explorer of the VBA IDE?

    What do they see there in the other workbooks?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Workbooks collection only returns one open workbook in Excel 2016

    Norie,

    I didn't think to look specifically at what the IDE was showing when I was at the office. It'll take some time to answer your question because I don't have a test environment set up for 2016 yet. Need to set up a VM. I'll get back to you ASAP.

    Thanks
    Peter

+ 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. Open 2 workbooks in Excel 2016 cannot click controls or enter cells
    By Jason_Chan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-27-2017, 12:03 PM
  2. [SOLVED] today() in Excel 2010 32 bit vba returns different value than Excel 2016 64bit
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-10-2016, 12:34 PM
  3. Merge two workbooks Excel 2016
    By jamessmckie in forum Excel General
    Replies: 1
    Last Post: 07-01-2016, 10:11 AM
  4. Excel 2016 - Linking workbooks
    By pccamara in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2016, 01:38 PM
  5. Open multiple workbooks in directory, copy a range to them for data collection
    By agutman50 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-28-2014, 01:24 PM
  6. how to open the workbook and add into workboooks collection
    By yeekhoon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2007, 06:44 AM
  7. Workbooks collection is empty even though the some of the document is open
    By thangarasu@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-28-2005, 06:55 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