I am trying to make a macro for my colleagues during my internship. I think my code should be fine. The only problem is that the code works on my computer but shows an error code when my colleagues try to us it. I already adjusted the code to their disc locations.
I really have no idea what is going wrong.
I received the following error code:
Run-time error '1004': Method 'SaveAs' of object '_Worksheet' failed
We are working in the same Excel version and network.
Is there someone who can help me?
Sub nieuw4()
Sheets("Output IE").Select
Sheets("Output IE").Copy
ActiveSheet.Shapes.Range(Array("Button 6")).Select
ActiveSheet.Shapes.SelectAll
ActiveSheet.Shapes.SelectAll
Selection.Delete
Range("B8:U33").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlNoRestrictions
ActiveWorkbook.Saveas FileName:="U:\MACRO test\BREAKDOWN RAS TEST 17052021\Output IE\" & _
"Breakdown - " & Workbooks("Test Ras breakdown per markt 20211.xlsm").Sheets("Grid inladen").Range("A2") & (" - ") & Workbooks("Test Ras breakdown per markt 20211.xlsm").Sheets("Grid inladen").Range("C2") & ".xlsx"
End Sub