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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

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