

#My excel keeps crashing when recording a macro code
Our final 6 to 8 step solution is quite simple since it seems to be a bug with the runtime on compiled macro code workbooks that have been saved and opened anew: as if it slowly internally crashes before it will disappear automatically (also from task manager) (sometimes without the immediate auto-restart dialog). When one debugs/inspects the variables, strange things happen (other objects shown than expected, visual sections of excel elements get completely white/broken). Our problem occurs at definite, always reproducible code locations. So it must be some pretty bad compiled-code processing bug. (see solution below if you don't care about this :) )įor us it happened in code that compiles and runs successful in Excel 2010, 20. I experienced today that this can also resolve "Can't find project or library" crashes where no reference is actually missing and Excel crashes before you can even get to the reference dialog in the first place. Close Excel, re-open the previously crashing workbook, and Enable Macros.Revert any changes you made to Macro Security in steps 3-5.Save the VB project again and then save the Excel workbook.

In the VB Editor, save the project and then click Debug > Compile VBAProject.Do not click "Enable Macros" - instead go to the Developer Tab and.Go to Trusted Documents and check the “Disable all Trusted Documents” box.Go to the Trusted Locations tab on the left and check the “Disable all Trusted Locations” box at the bottom.Click the bullet option entitled “Disable all macros with notification”.Go to the Developer Tab and click “Macro Security” in the Code section of the Ribbon.Open a new Excel workbook, not your crashing workbook.To fix it, use the following steps (all credit to alulla at Ozgrid, whose directions I've lightly adapted for clarity): Therefore, in order to see it, the first thing we do is click on the program’s File menu, where we select Options.This is caused by a macro with a compile error. And is that the tab that allows us to access these functions is hidden by default.

In other words, it is a function aimed especially at advanced users, so a priori we may find that we do not see the corresponding option. The first thing to know is that Excel macros are especially suitable for users who already have certain knowledge of the program. Enable the Developer tab to create a macro They also serve to assign formats to the different sheets or to organize certain contents of them. In addition, they will allow us to save time, efforts, and increase the functionality of the project in which we work.įor those of you wondering, we will tell you that these elements, macros, are often used when filling in data repeatedly, replicating the composition of a certain number of cells or repetitive actions, etc. In addition, creating these elements is not complicated at all, Excel itself takes care of it. As you can imagine, the main purpose of all this is to automate certain routine and repetitive activities. It should be mentioned that a macro is actually a small program or set of instructions that we define ourselves. In fact, there are many programs, not just Excel, that have them. This will be very helpful with those repetitive tasks that we comment on, we refer to macros. But even if necessary, the Microsoft program offers us a good solution for all this. This is becoming more and more common, especially as the project grows, which can be a significant waste of time.
