none
Bug in the Excel 2016 object model: a macro demonstrating the issue supplied RRS feed

  • Question

  • Hello,

    Consider this VBA macro:

    Public Sub TestWindows()
    
    Dim wnd1 As Window
    Dim wnd2 As Window
    
    Set wnd1 = ActiveWorkbook.Windows(1)
    Set wnd2 = ActiveWorkbook.Windows(2)
    
    wnd1.Left = 0
    wnd1.Top = 0
    
    wnd2.Left = 100
    wnd2.Top = 100
    
    Set wnd1 = Nothing
    Set wnd2 = Nothing
    
    End Sub
    The macro above is expected to move two Excel windows to different locations: (0, 0) and (100, 100). Start Excel 2016, create a new workbook (if required), click New Window on tab View. At this moment you have two Excel windows titled "Book1 - 1" and "Book1 - 2". Make sure they are non-expanded. Run the macro to find the second window left in the same position and the first window moved first to (0, 0) and then to (100, 100). The issue is reproducible on 8431.2046 32bit and 8530.1000 32bit. It isn't reproducible on 8229.2103 64bit (ProPlus). We can't reproduce the issue if we open two workbooks.

    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Monday, September 18, 2017 2:16 PM

Answers

  • Hello,

    I could reproduce the issue in Office 365 ProPlus Version 1707 8326.2107 64bit and 1708 8432.2079 (the latest version updated on 9/18/2017 for monthly channel).

    If you debug the macro, you could find the wind1 and wind2 are referring to the same widows "Book1".  I think the names "Book1 - 1" and "Book1 - 2" are wrong and causes the issue. They are "Book1:1" and "Book1:2" in previous versions. If you see it use "-" instead, we are unable to output correct captions for the two windows or rename the captions or reference the two Window objects.

    The issue causes from Office updates. To work around, you may convert to an earlier version. Besides, I suggest you visit https://support.microsoft.com/en-my to create an incident about the issue, you won't be charged if the support engineer determines that the issue is the result of a bug.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Andrei Smolin Tuesday, September 19, 2017 8:44 AM
    Tuesday, September 19, 2017 3:20 AM
    Moderator

All replies

  • Hi Andrei,

    I tested in 32-bit Excel 2016 Click-to-Run version 8326.2107 (the current version for the Current Channel). The two windows are moved as intended to (0, 0) and (100, 100).


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Monday, September 18, 2017 2:31 PM
  • Hello Hans,

    Thank you very much! I assume your result means the issue was introduced recently.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Monday, September 18, 2017 2:34 PM
  • Hello,

    I could reproduce the issue in Office 365 ProPlus Version 1707 8326.2107 64bit and 1708 8432.2079 (the latest version updated on 9/18/2017 for monthly channel).

    If you debug the macro, you could find the wind1 and wind2 are referring to the same widows "Book1".  I think the names "Book1 - 1" and "Book1 - 2" are wrong and causes the issue. They are "Book1:1" and "Book1:2" in previous versions. If you see it use "-" instead, we are unable to output correct captions for the two windows or rename the captions or reference the two Window objects.

    The issue causes from Office updates. To work around, you may convert to an earlier version. Besides, I suggest you visit https://support.microsoft.com/en-my to create an incident about the issue, you won't be charged if the support engineer determines that the issue is the result of a bug.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Andrei Smolin Tuesday, September 19, 2017 8:44 AM
    Tuesday, September 19, 2017 3:20 AM
    Moderator
  • Thank you very much, Celeste!


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Tuesday, September 19, 2017 8:44 AM