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.
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