Prevent 'Run-time error '7' out of memory' error in Excel when using macro
- by MasterJedi
I keep getting this error whenever I run a macro in my excel file. Is there any way I can prevent this? My code is below. Debugging highlights the following line as the issue:
ActiveSheet.Shapes.SelectAll
My macro:
Private Sub Save()
Dim sh As Worksheet
ActiveWorkbook.Sheets("Report").Copy 'Create new workbook with Sheets("Report"(2)) as…