Search code examples
vbaexcelexcel-2013

Adding new Workbook in VBA crashes Excel 2013


When running VBA macro code

Sub x()
 Workbooks.Add
End Sub

Excel 2013 goes to "Not Responding".

If I run Add method with some template e.g. Workbooks.Add("C:\book1.xlsx") new workbook based on template is created successfully.

When I try to generate code by macro generator for new workbook creation, same macro as I posted is created. But result of run of this recorded macro is same as running my code - Excel 2013 freezes.

How to solve this? Code was working without issue in Excel 2007.


Solution

  • I needed to uninstall and install Office 2013 again to solve this issue. Installation repair did not helped.

    Whole story: I had installed Office 2003, Office 2007. Then I wanted to install Office 2013 (new customer request). Installer of Office 2013 complied about corrupted installation of Office 2003 and thus I needed to uninstall Office 2003 before installation could processed. To be on the save side I uninstalled Office 2007 as part of installation process of Office 2013. Installation was completed successfully but as I discovered later, not all was working as expected...