In your main code you have
which is used to disable a couple of things and make the code run more efficiently, another line you can use here is
Which turns of automatic calculation, then
which turns it back on again after the code has finished.
Also, if your code is ended prematurely (for example, by killing the process when it hangs or ending the code when it errors), these settings do not automatically re-enable, you need to do it manually. These are excel settings, not workbook settings, so closing without saving will not cancel out the original change to disable them. The simple way to do this is with a small piece of code like
Regarding the runtime error, does the workbook 'New Workbook Name.xlsx' actually exist? If that workbook is not open then you would need to specify the full workbook file path, not just the name.
See if this extract from PeltierTech (<<link to page) helps, it shows the correct way that the code should be written for what you're trying to do.
Hopefully this is of some use. I expect that Rory (romperstomper) will have significantly more knowledge and experience than I do relating to chart use and will (hopefully) provide further assistance.
Don't be afraid to ask if there is something you don't fully understand.
Bookmarks