Only in AutoCAD 2025 (not Civil 3D 2025) I get a crash when I exit it everytime I load (and not necessarily run) any VBA routine. Other people that I'm in contact with are getting the same.
Is that an AutoCAD bug? Any thoughts?
Thanks
Solved! Go to Solution.
Solved by p_goodman. Go to Solution.
Solved by norman.yuan. Go to Solution.
Yes, I can reproduce the issue as you described. But I would not say it is AutoCAD 2025 crash: it is only after AutoCAD is fully closed (from Task Manager, I can see acad.exe is gone) AutoCAD's famous "Report Error" window pops up. And yes, it only occurs with vanilla AutoCAD 2025 when any VBA project is loaded. Coincidently, I also have C3D 2025 installed, which does not have the same issue. It does not hurt AutoCAD use since it only occurs after AutoCAD is closed down, but the popping up window is annoying.
Also, Setting AutoCAD's system variable "ReportError" to 0 does not surpress the "Report Error", like it would do to "common" crash occurred during AutoCAD session. So, I guess the "Report Error" window is called up not by AutoCAD itself, but by one of the Autodesk apps installed along with AutoCAD, and it is the fault of this "unknown-to me" app. It looks like this should be reported to Autodesk as a support case, which I might do it as soon as I can manage of bit of time, but hopefully someone else have already reported it.
Update - I have contacted Autodesk support: this has been a known issue for the AutoCAD development team. They will have it fix in future service pack or even next version release, just don't know when. Fortunately, this does not affect AutoCAD running, except for the annoying "Report Error" showing up after AutoCAD is shut down.
Here too. But it is a LOT more annoying: the Rubberduck VBE add-in can not be used anymore. Every time it is loaded into AutoCAD's VBE it crashes.
I just upgraded to AutoCAD 2025 and after installing the VBA enabler, this behavior began. Everything seems to close correctly but after a brief delay the crash report dialog pops up.
I rely on the use of VBA routines to get my work done. Just telling me that "it does that - nothing can be done" (paraphrasing, I know.) won't cut it. This did not happen with AutoCAD 2024 (but it started misbehaving* and I thought I could just upgrade.)
*misbehaving = as soon as I hit the main menu file, the whole application crashed. Just started this morning after months of working normally. Autodesk has removed the "repair" option from the installer.
Just to be sure, in the VBAIDE, go to Tools>References and make sure that none say "MISSING" and that you are referencing 2025 tlb's. If you are getting errors, post a screenshot.
I just installed 2025.1 with the VBA module and AutoCAD seemed like it was closing normally, but it still generated an error report. If you keep sending error reports, maybe they'll get it fixed sooner. Otherwise you can just close the report tool without sending. But you can still use VBA commands.
Are you still able to work? and your vba routines work? If it's just the error on closing the app, just keep reporting it.
I am able to load and run various VBE utilities that I normally use. There are times when one or more crash report dialogs are triggered while working. They are annoying but do not prevent working.
I've done some more troubleshooting and will report my findings in the next post.
There is a single action that will trigger the crash report.
This bug is only related to triggering an error report on closing acad. If you are getting other crashes, it's likely due to your code.
BTW, It's VBA, Visual Basic for Applications. VBE is the Visual Basic Extensibility library that let's you code for the visual basic editor and it's modules.
I've been troubleshooting my VBE project to try to determine what triggers the crash report dialog.
I got to this point by adding fragments of my normal VBE project (that worked quite well under AutoCAD 2024, thank you.) and testing for the crash report dialog box being triggered on exit from AutoCAD 2025. It wasn't until I got to a declaration of a user type of a UserForm that wouldn't compile that I discovered any correlation.
Down the rabbit hole, I found that Microsoft Forms 2.0 ... does not appear in the "Available References:" list under Tools/References. Checking on the web, I found that in the AutoCAD VBE, as soon as you insert a UserForm, a reference to Microsoft Forms 2.0... appears. I also found out by experimentation that you can't un-check this reference-- even after removing all UserForms from the project. (I haven't found any way to rescue the project from this "corruption")
So, there's your hint. Can Autodesk step up and fix this? FM20.DLL is an ancient component. It includes a well-known bug in the DataObject (clipboard access) that mangles multibyte text if, and only if, more than one File Explorer window is open (by legend, this has existed since Windows 8!)
I will be able to live without any UI forms in my project - I don't have any I'm in love with.
But I would really like to be able to use clipboard access (via the DataObject type) without having to diligently close Windows File Explorer windows.
Yes, I'm aware that I can create VBA code that does a windows system call to access the clipboard - I just haven't taken the time to incorporate it into my VBE project and update the subroutines that already use the DataObject. Maybe I'll get around to it now.
But, I upgraded to 2025 because on Monday, my AutoCAD 2024 started crashing as soon as I tried to open the main File Menu (either by mouse, keyboard ALT+F shortcut.) And, there is no longer a "repair" option in the AutoCAD installer. ;-(
@DavidTosh wrote:
But, I upgraded to 2025 because on Monday, my AutoCAD 2024 started crashing as soon as I tried to open the main File Menu (either by mouse, keyboard ALT+F shortcut.) And, there is no longer a "repair" option in the AutoCAD installer. ;-(
I always do a clean uninstall anyway.
@DavidTosh wrote:
I should have said VBAIDE?
Yes
In fact, that's the name of the acad command that does Alt+F11.
First, you need to make sure that none of your code is causing any crashes. One quick troubleshooting tip is to use Debug>Compile. This will highlight any syntax bugs. Next, you need to make sure you trap any runtime errors. If you don't have any error handler in a sub or function, it will bubble up to higher level subs and be hard to locate the source. If you don't have any error handler, then acad has to handle it, which may cause a crash. I always include the following structured error handler in my subs. It handles runtime errors caused by the sub, and reports which sub the error occurred in. If there's an error, it then exits the sub gracefully.
Also note that in my testing of 2025, merely installing VBA caused the bug.
Public Sub SampleCommand()
On Error GoTo Err_Control
'Set up undo for this command
ThisDrawing.StartUndoMark
'do your normal process
'Normal code execution exits here if there are no errors.
Exit_Here:
ThisDrawing.EndUndoMark
Exit Sub
'Start of structured error handler
Err_Control:
Select Case Err.Number
Case -2147352567
If GetAsyncKeyState(VK_ESCAPE) And &H8000 > 0 Then
Err.Clear
Resume Exit_Here
ElseIf GetAsyncKeyState(VK_LBUTTON) > 0 Then
Err.Clear
Resume
End If
' Case -2145320928 'substitute with applicable error number.
' 'Add your error handler here
' 'Handle new error.
' Err.Clear
' Resume Exit_Here
Case Else
MsgBox Err.Number & " - " & Err.Description, vbCritical, "SampleCommand" 'change to the name of your command.
Resume Exit_Here
End Select
End Sub
Can't find what you're looking for? Ask the community or share your knowledge.