Hi,
I am trying to save a new workbook, but it will not work. Get a runtime 1004 error.
Can anyone help?
I am trying to save a new workbook, but it will not work. Get a runtime 1004 error.
Can anyone help?
Code:
Sub test()
Dim wb As Workbook
Dim wb2 As Workbook
Dim ws As Worksheet
Dim dte As String
Set wb = ThisWorkbook
Set ws = wb.Sheets("Signed EUR")
dte = ws.Range("N28").Value
ws.Cells.Copy
Set wb2 = Workbooks.Add
wb2.Sheets(1).Cells(1, 1).PasteSpecial xlPasteValues
wb2.SaveAs Filename:="S:\QA\Clients\Insight\" & dte & ".xlsx", FileFormat:=xlNormal
End Sub