Breadcrumbs

Error: Not enough memory resources are available to complete this operation

Overview

While using the Velixo Snapshot feature or distributing reports where formulas are being removed, the following error message is displayed:

https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153021574198/original/TaCBSnMTvvwLTmGdVDqDqeEkRC4Ny7xO1w.png?1722525386

Most likely cause

The error message is very accurate. Excel has run out of memory while trying to create the requested copy of the workbook.

The most likely cause of this error is that somehow MANY (often hidden) named regions have been created within the workbook.

When this occurs, it is typical that the Excel Name Manager...


https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153066119014/original/b5J37dN0EiNNrKl9koa_jFnj79dSXJ0YPQ.png?1751974355


... is not even able to open to process them all (this is an effective first step in identifying the issue). 

Resolution

To clean up the named references, we prepared an Excel macro you can use in your problematic workbook. Start by typing "macros" in the Excel help search and open the View Macros menu.

https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153066109286/original/Utu0mY_-uQi24NchX17XhTkjGE9STqBqmg.png?1751970074


Name your macro, e.g. "CleanHiddenRefs", select to apply it in This Workbook only in the Macros in: dropdown and click Create.

https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153066110723/original/u8Wt2MzFnGVmWgeaQTvsOofyZLXBQNivIw.png?1751970779


In the Visual Basic editor that appears, paste the following code:


Sub CleanHiddenRefs()
    Application.Calculation = xlCalculationManual
    Application.EnableEvents = False
    
    Dim nName As Name
    Dim lCount As Long
    
    With ActiveWorkbook
       For lCount = .Names.Count To 1 Step -1
            If lCount Mod 100 = 0 Then
                Debug.Print lCount
                DoEvents
            End If
          
            If .Names(lCount).Visible = False Then
                On Error Resume Next
                .Names(lCount).Delete
                If Err.Number <> 0 Then
                    Debug.Print "Failed to delete name " & .Names(lCount).Name
                End If
                On Error GoTo 0
            End If
       Next lCount
    End With
    
    MsgBox "Done! " & ActiveWorkbook.Names.Count & " remain.", vbInformation
    Application.EnableEvents = True
    Application.Calculation = xlCalculationAutomatic
End Sub


Make sure it looks as follows and click the Save button:

https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153066111461/original/l0yH1tXg7xkoSqyD555gwfqS-SfdOzROMw.png?1751971101


Click Save in the window that pops up.


https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153066112060/original/jqWcqreyh2SoYYQ3fSMM6iTeGL5DHL8EpQ.png?1751971397


Click Run in the Microsoft Visual Basic window.

https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153066112312/original/e21MCwuxy6Yad4vlmjyMF31oh6Z5r2odNA.png?1751971539


The macro will now remove (most) of the hidden references in your workbook. This part may take up to several minutes, depending on the number of references to be removed. Once done, Excel will display a message similar to the one below.

https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153066112634/original/QcFeh8Sa8eDSxKHW4f2dygX4Jxq20tJEfA.png?1751971708


Now, you should be able to view the remaining references in the Name Manager and remove broken ones by selecting them and using the Delete button.

https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/153066113057/original/MnFJTysVQUoTIOTuG7Q7yR2_HK53PLn0Jg.png?1751971942


At this point, you should be able to use the Snapshot feature or distribute reports without formulas.


If the issue persists after applying the resolution above, it may indicate that your machine does not have enough available RAM for the features to work properly.