Jason Chan
New Member
- Joined
- Jul 17, 2015
- Messages
- 27
Hi all,
I created a multi-sheet main workbook of many sheets (the destination workbook, which has code) that calls and opens a simple 1-sheet secondary workbook (the source, without any code). When the main is opened each time, it calls the secondary file to be opened. The secondary file is just a 1-sheet plain workbook containing repopulated data from the web. The main workbook is made up of sheets that have many formulae to calculate data presented in the source. This was a 100% all fine (still is) under Excel 2010. There is no file linking, no need because I only need to open the main, and the main opens the secondary and recalculates itself via all the formulae it has on the data it refers from the secondary.
Recently, in line with company actions I had to install and use Excel 2016. Now, when i open the same main workbook a peculiar problem arises. When opening main is complete, the active window (focus) has turned to become the secondary workbook. With this, I have to manually click the mouse on the destination workbook every time after opening the main because the active window is now the source workbook's window. No code has been changed, yet this happens. When i try to workaround this by adding a code in the destination under the OpenSecondaryFile SUB as follows:
ActiveWindow.WindowState = xlMinimized
to hide the secondary file so that the main is shown first after opening, this on the onset appears to have worked as after opening is complete, the active window has shown back to the main workbook again. However, something else happens: Excel 2016 strangely and stubbornly doesn't allow me to type on or click on any buttons on the main AFTER allowing only just 1 click or 1 cell activate on any button or cell on the main. But, if I shift focus away from the main workbook before clicking any button or cell by JUST selecting ANY window, which can be any active window or application or browser, or even just the plain Windows desktop page, or the secondary file, the main workbook is normal and allows again, just like when in Excel 2010 would. Why is this so? Why Excel 2016 is presenting this issue? I also noticed that after adding the above code, although the focus switched back to the main workbook, but the top right corner’s standard window maximize, minimize, close controls are grayed out. When I shift the focus to another window or workbook and return to the main, all is normal again and the controls are no longer grayed out.
I tested my file in my old Excel 2010 and none of the above happens and my main workbook still opens normally and is the first to appear on screen, as it has always been before I use Excel 2016.
How can I solve this? Any ideas or solutions out there?
sincerely,
Jason.
I created a multi-sheet main workbook of many sheets (the destination workbook, which has code) that calls and opens a simple 1-sheet secondary workbook (the source, without any code). When the main is opened each time, it calls the secondary file to be opened. The secondary file is just a 1-sheet plain workbook containing repopulated data from the web. The main workbook is made up of sheets that have many formulae to calculate data presented in the source. This was a 100% all fine (still is) under Excel 2010. There is no file linking, no need because I only need to open the main, and the main opens the secondary and recalculates itself via all the formulae it has on the data it refers from the secondary.
Recently, in line with company actions I had to install and use Excel 2016. Now, when i open the same main workbook a peculiar problem arises. When opening main is complete, the active window (focus) has turned to become the secondary workbook. With this, I have to manually click the mouse on the destination workbook every time after opening the main because the active window is now the source workbook's window. No code has been changed, yet this happens. When i try to workaround this by adding a code in the destination under the OpenSecondaryFile SUB as follows:
ActiveWindow.WindowState = xlMinimized
to hide the secondary file so that the main is shown first after opening, this on the onset appears to have worked as after opening is complete, the active window has shown back to the main workbook again. However, something else happens: Excel 2016 strangely and stubbornly doesn't allow me to type on or click on any buttons on the main AFTER allowing only just 1 click or 1 cell activate on any button or cell on the main. But, if I shift focus away from the main workbook before clicking any button or cell by JUST selecting ANY window, which can be any active window or application or browser, or even just the plain Windows desktop page, or the secondary file, the main workbook is normal and allows again, just like when in Excel 2010 would. Why is this so? Why Excel 2016 is presenting this issue? I also noticed that after adding the above code, although the focus switched back to the main workbook, but the top right corner’s standard window maximize, minimize, close controls are grayed out. When I shift the focus to another window or workbook and return to the main, all is normal again and the controls are no longer grayed out.
I tested my file in my old Excel 2010 and none of the above happens and my main workbook still opens normally and is the first to appear on screen, as it has always been before I use Excel 2016.
How can I solve this? Any ideas or solutions out there?
sincerely,
Jason.