On 19 February, 2015, IT pushed Security Updates (see below for list). The following day several macros failed to execute. A closer look at the code revealed that the problem occurred when toggling between excel workbooks. Specifically, the "Windows.Activate" did not happen causing the next line of code to give a subscript out of range error. The worksheet couldn't be found in the still active incorrect workbook. The macros affected were written years ago and have worked without incident for years.
To test this, I created 3 files and recorded various toggling actions. These recorded lines of code also failed, showing me that there is nothing wrong with the code itself, but in the way the machine was able to execute it.
I also tried the failing macros on other machines to determine whether this was my machine or if other were affected. Again the result was the failure.
Please help! We rely on these workbooks to make important business decisions daily!
Here is the test code I created to illustrate the failure. In this code, the failure occurs when Test 3 should be activated.
Sub Macro1() ' ' Macro1 Macro ' ' Windows("Test 2.xlsx").Activate Sheets("Sheet2").Select Range("A1:C3").Select Selection.Copy Windows("Test 1.xlsm").Activate Sheets("Sheet2").Select ActiveSheet.Paste Windows("Test 2.xlsx").Activate ActiveWorkbook.Save ActiveWindow.Close Windows("Test 3.xlsx").Activate Sheets("Sheet1").Select Range("A1:C3").Select Selection.Copy Windows("Test 1.xlsm").Activate Sheets("Sheet3").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Sheets("Sheet1").Select Windows("Test 3.xlsx").Activate ActiveWorkbook.Save ActiveWindow.Close Sheets("Sheet1").Select ActiveCell.FormulaR1C1 = "The End" Range("A2").Select End SubHere are the updates that were installed.
KB2810073, KB2687423, KB2880971, KB2850016, KB2956066, KB2920748, KB2956081, KB2687455, KB2826023, KB2837597, KB2956073
Thanks! Keith |