Really should be a new thread, but the answer is straightforward.
When using Workbooks(...) you only need the workbook name, Filepath includes the path and filename.
Try replacing Workbooks(FilePath) with Workbooks(FileName & ".xlsx").
Or create a reference to the new workbook.
![]()
Dim wbNew As Workbook ' other code Set wbNew = Workbooks.Add With wbNew .SaveAs Filepath With .Sheets("Sheet1") .Range("A1") = "test" End With End With
Bookmarks