+ Reply to Thread
Results 1 to 4 of 4

Excel 2013 SDI vs MDI - Setting Active Workbook When Opening from Code

  1. #1
    Registered User
    Join Date
    03-16-2004
    Posts
    23

    Excel 2013 SDI vs MDI - Setting Active Workbook When Opening from Code

    Hello,
    Code working in previous excel versions is no longer working in 2013 - I open a file (say, source file) with code (say, destination file) to extract some data into a user form. Focus normally remains on the original (destination) workbook with the user form active. Now, focus goes to the opened (source) file, and I can't change the active workbook. Windows().Active and Workbooks().Activate does not work. Oddly, stepping through the code line by line does seem to work, but running the macro does not. Does this need to be handled differently with the SDI format?
    Thank you!

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Excel 2013 SDI vs MDI - Setting Active Workbook When Opening from Code

    There are some quirks with SDI and userforms. Why do you need to actually activate either workbook?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    03-16-2004
    Posts
    23

    Re: Excel 2013 SDI vs MDI - Setting Active Workbook When Opening from Code

    Hi,
    Once the destination file userform grabs some information from the source file, the user has to make some additional selections on the userform. So what's happening is the user only sees the source file, and it looks like the destination file and userform has disappeared - that's why it needs be active when the macro finishes. (And the source file needs to remain open as some additional operations are performed on that file to get data.)
    Thanks!

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Excel 2013 SDI vs MDI - Setting Active Workbook When Opening from Code

    That does sound like a bug. I don't have 2013 here to test but will try and reproduce tomorrow and see if it's a known issue. If not, I'll file it as a bug.

+ 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] Code to detect previous active workbook instead of current active workbook
    By kosherboy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-25-2014, 01:58 AM
  2. Userform in Excel 2013 disappears while switching an active workbook behind
    By blackarrow in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-17-2013, 09:08 AM
  3. Opening an Excel file in the last Active Workbook
    By tdsmith14 in forum Excel General
    Replies: 0
    Last Post: 04-10-2013, 03:05 PM
  4. how to run macro from active workbook, without opening source workbook??
    By etminasm in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-06-2010, 09:34 AM
  5. Setting a range in non-active workbook
    By kingdt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2010, 05:51 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