Forum Discussion

Brad Carr's avatar
Brad Carr
Copper Contributor
Jun 10, 2017

Workseet.copy crashes Excel every time

I recently ran updates for MS Office and version of Excel is 2016  MSO (16.0.8067.2115) 32-bit.

 

VBA code that worked perfectly prior to the upgrade now causes Excel to crash at the same place every time.  A portion of the code is below.  It does not give an error, it simply crashes Excel.  Please don't tell me it is the code's fault because prior to updating it worked every time.  

 

Thank you

 

Dim SPWB As Workbook
Set SPWB = ThisWorkbook

Dim spmenu As Worksheet
Set spmenu = SPWB.Sheets("Sales Portal Menu")
Workbooks.Open Filename:=TrackerPath
Dim wb1 As Workbook
Dim ws1 As Worksheet
Set wb1 = Workbooks("Order and Shipment Tracking.xlsm")
Set ws1 = wb1.Sheets("Executive Reports")
ws1.Copy After:=spmenu  THIS IS WHERE IT CRASHES EVERY TIME

Resources