Dear alll,

I have a curious problem - I have a complex VBA project, part of which allows users to export 5 worksheets to a new workbook, after which the new workbook is activated. This works fine in Excel 2010 but when I run the code in 2013, 2 strange things happen:

1. the nb.Activate line in the code seems to activate the originating workbook and vice versa, ThisWorkbook.Activate shifts focus to the new workbook;

2. when clicking on the X to close the window of the new workbook, the originating workbook closes instead.

It's very frustrating and seems to be a problem only in Excel 2013 - it'd as if the Application processes are getting confused about the identity of the two workbooks but even when I use the code Workbooks("NewBook.xlsx").Activate instead, it still activates the wrong workbook. Has anyone else encountered this?

It is worth noting that this is happening while the originating workbook has two Userforms open in it - this could be a factor.

Any thoughts?