wisconsinbad.blogg.se

Microsoft visual basic for applications out of memory
Microsoft visual basic for applications out of memory










microsoft visual basic for applications out of memory

The code for the first (buttons) ThisWorkbook is Private Sub Workbook_Activate()Īpplication.ExecuteExcel4Macro "show.toolbar(""Ribbon"",false)"Īpplication.OnKey "%", "ToggleRibbon" I realise that the problem is almost certainly generated by the Open or Activate events, but I have no idea where to look next, and I have no idea why the problem is not there when the VBE is not open.Ī ny guidance will be much appreciated. Under any other combination of circumstances there is not a problem. So to summarise, if I have two specific workbooks open and the VBE open, when I close one specific workbook I get the Out of Memory message. Only the code in the second (data) workbook has changed recently and the problem has now appeared. If I comment out all the Workbook activate code in the first (buttons) workbook, the problem goes away, but that defeats the whole purpose of the workbook, and the code has been unchanged for a few years. I have tried incrementally commenting out all the code in the Workbook Open Event of the second (data) workbook and the problem remains. The problem is not apparent with any other combination of workbooks. If I first open a blank workbook and the VBE and enter into the Immediate Window “application.enableevents = false” before opening the two workbooks the problem does not occur. None of the workbooks has any objects defined. The problem does not affect other workbooks, so if I have the first workbook (with the buttons) open with another workbook (that is also macro enabled and has Workbook Open events), I can close that workbook without Specifically, if the VBE is not open, there is not a problem. The problem occurs only when I close the second workbook (containing the data), and only when all three conditions above are true. Both are macro enabled and both have ThisWorkbook events (Activate for the first and Open for the second), but not BeforeClose events. The second is a larger workbook consisting of 11 sheets and 351 Kb in size Įach worksheet contains multiple rows of data about parts kept in stock. The first is a workbook of 79 Kb, consisting of a single worksheet showing buttons that are clicked to call various procedures, mostly to open other workbooks in a suite of sheets. (Not the code error message with the Debug option - a simple error message box with OK and Help buttons).

microsoft visual basic for applications out of memory

I always receive a Visual Basic For Applications error message “Out of Memory” when I close one workbook under certain defined conditions.












Microsoft visual basic for applications out of memory