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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,215,043
Messages
6,122,822
Members
449,096
Latest member
Erald

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