I have the following code in order to copy a sheet from a workbook and paste it on the sheet 1 of another workbook called "Control_de_precios":
Sub createSpreadSheet()
Set NewBook = Workbooks.Add
With NewBook
.Title = "Control_precios_ddmmaaaa"
.Subject = "Control_de_precios"
.SaveAs Filename:="Control_precios_ddmmaaaa.xls"
End With
ThisWorkbook.Worksheets(1).Activate
Cells.Select
Selection.Copy
NewBook.Sheets(1).Activate
ActiveSheet(1).PasteSpecial xlPasteValues
End Sub
The problem is that I get the 438 error because the last instruction, and I don't get to paste values on my new workbook. If I change it for:
ActiveSheet(1).Paste
I don't get the 438 error, and I get to paste the formulas, but I want to paste the values.
¿Could anyone help me?