Hey Guys,
so I'm trying to have the output data (created earlier in the same Macro) copied to a new Workbook which then would be saved in the same path as the Macro and named using current (system) month. My code is this:
targetSheet1 is a value defined earlier in the code and means simply the Sheet in which the output (which I want copied to a new Workbook) is located.![]()
Please Login or Register to view this content.
When running the macro I get the "Object variable or with block variable not set" error and the newWorkbook = Workbooks.add is highlighted.
The new Workbook gets created, but obviously the macro is interrupted, so nothing is copied and the file is not saved.
I was afraid this would happen as I'm not entirely familiar with working with new workbooks... Can someone explain what happened here and how to correct it?
Bookmarks