I want to add a new sheet in a Macro Enabled Excel File using VBA.
It doesn't matter the method that I use:
- Sheets.add
- Copying and pasting a sheet to create a new one
The new sheet is created (or copied) but the macro stops immediately, without any message error, and the rest of the code is not executed.
I converted the file to XLSX and when I run the code, the sheet is created and the code execution continues perfectly.
That's why I think that it is related to the Macro Enabled Excel type of file.
UPDATE:
I tested the code in another PC and Excel installation and the new sheet is created and the code goes on.
The only difference between the two computers is the Excel 2016 version:
Standard in one and Professional in the other.