Hello,
at work they updated excel to 2019 version and now my distribution macro crashes excel.
when following the macro step for step, it looks like the new workbook to copy 1 sheet to doesn't have any sheets
.
at work they updated excel to 2019 version and now my distribution macro crashes excel.
when following the macro step for step, it looks like the new workbook to copy 1 sheet to doesn't have any sheets
VBA Code:
'''''''''''''''''''''' WRITE TO A NETWORK DRIVE ''''''
'''''''''''Dim paths for filename to cells'''''''''
Sheets("Distribution").Select
Dim Path As String
Dim filename As String
Path = ActiveSheet.Range("E2")
filename = ActiveSheet.Range("D2")
Dim wb As Workbook
Sheets("KPI").Copy
Set wb = ActiveWorkbook
With wb
Range("A1").Select
ActiveCell.End(xlDown).Offset(2, 0).Select
ActiveCell.End(xlDown).Offset(2, 0).Select
ActiveCell.End(xlDown).Offset(2, 0).Select
Rows(ActiveCell.Row & ":" & Rows.Count).Delete
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs filename:=Path & filename & ".xls", FileFormat:=xlNormal
Application.DisplayAlerts = True
Application.DisplayAlerts = False
ActiveWindow.Close
Application.DisplayAlerts = True
End With