Out of Memory Error

Hap

Well-known Member
Joined
Jul 20, 2005
Messages
647
I am getting an out of memory error when after closing the workbook in the following code. I have an Add-in that opens another workbook and runs other code which opens a form and allows the user to interact. When the form is closed the workbook closes and doesn't save per the code below. As soon as it exits the workbook VBA throws the Out of Memory error. I had previously set the other workbook as an object. I thought maybe it wasn't releasing the memory from the additional workbook open correctly but I'm still getting the error. Any suggestions are greatly appreciated.


Code:
Private Sub CommandButtonHSS_Click()
    
    Dim f As String
    Dim p As String
    Dim r As String
    
    f = "HSS Connection Designer 180611.xlsm"
    p = "H:\WSDATA\eng48\Steel\"
    
    Workbooks.Open (p & f)
    r = "'" & p & f & "'!Module1.Main"
    Application.Run r
    Workbooks(f).Close False
    
End Sub
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top