none
Excel 2016 background RRS feed

  • Question

  • There are 2 Excels opened and we are using VBA code to switches the workbook

    • Currnet active workbook  is sheets1.xls
    • Another workbook is  sheets2.xls . Variable ActWkb is storing this workbook.

    When we run below VBA code to switches the workbook , it is working fine in Excel 2010 .

    However, in Excel 2016, it is still showing "sheets1.xls" as active workbook.

      

                MsgBox " Current Active : " + ActiveWorkbook.Name + ", variable ActWkb: " + ActWkb.Name  

                    ' It is showing Current "sheets1.xls"      

                ActWkb.Activate

                 'try to switch to sheets2.xls as active workbook

                 Windows(ActWkb.Name).Activate
                MsgBox " After switching : " + ActiveWorkbook.Name

                'It is still showing "sheets1.xls" as active workbook in Excel 2016. It is showing "sheets2.xls" in Excel 2010

    Can you please kindly help ?

    Friday, November 4, 2016 3:03 AM

All replies

  • I tested your code in Excel 2016 (fully updated). It worked as intended:


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

    Friday, November 4, 2016 10:00 AM
  • Hi,

    It works fine for me with 16.0.7329.1017 32-bit and 16.0.7426.1009 64-bit.

    What is your specific version? Do you try to create a new macro and test only these code?

    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.

    Friday, November 4, 2016 1:14 PM
    Moderator