Hello. I want to do the following from an existing workbook:
1) Open new workbook
2) Do some stuff (for now its just inserting some random values)
3) Copy the sheet (I just need the values)
4) Close the new workbook WITHOUT saving
5) Insert values in the existing workbook
My attempt didn't work:
The first issues I'm running into: Doesn't close the workbook! And If I do it without "False" it asks me to save it.
Please Help
1) Open new workbook
2) Do some stuff (for now its just inserting some random values)
3) Copy the sheet (I just need the values)
4) Close the new workbook WITHOUT saving
5) Insert values in the existing workbook
My attempt didn't work:
Code:
Sub NewWorkbookToOldWorkbook()
Workbooks.Add
Worksheets.Add(After:=Worksheets(1)).Name = "Update"
Range("A1").Value = "test"
Range("A2").Value = "test2"
Range("B5").Value = "test3"
Range("C2").Value = "C2"
Range("E5").Value = 1
Worksheets("Update").Copy
ActiveWorkbook.Close savechanges:=False ' Also tried ActiveWorkbook.Close False
'Worksheets("Rawdata").Cells.ClearContents
'Worksheets("Rawdata").Range("A1").PasteSpecial xlPasteValues
End Sub
The first issues I'm running into: Doesn't close the workbook! And If I do it without "False" it asks me to save it.
Please Help