I'm trying to copy the contents of the active sheet to a new workbook.
Sub new_workbook()
Dim ExtBk As Workbook
Dim ExtFile As String
Columns("A:N").Copy
Workbooks.Add.SaveAs Filename:="output.xls"
ExtFile = ThisWorkbook.Path & "\output.xls"
Set ExtBk = Workbooks(Dir(ExtFile))
ExtBk.Worksheets("Sheet1").Range("A1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
Application.DisplayAlerts = False
ExtBk.Save
Application.DisplayAlerts = True
End Sub
I'm getting an error at the PasteSpecial
line with the error specified at the subject. I'm a bit confused since this works if I direct it to the source workbook.
Maybe I need to use Windows(output.xls)?