ExcelNewbie_2023
New Member
- Joined
- Sep 11, 2023
- Messages
- 6
- Office Version
- 365
- Platform
- Windows
I have a macro running to save workbooks from my current work book based on a list. It will run and save all workbooks until it gets to the last name in the list and I get a "Save Failed" and excel freezes. All other files save just fine, it is only when it reaches the last populated cell in the list that it freezes. I have to use task manager to force Excel to close.
Code:
Sub WorkBook_Generation()
'
' Create Workbooks From Audit Template with names stored in Column AG
Dim fName As Range
For Each fName In Range("AG1", Cells(Rows.Count, "AG").End(xlUp))
On Error Resume Next
ThisWorkbook.SaveAs Filename:=fName.Value, FileFormat:=50
Next fName
End Sub