0

We maintain ~130 VBA-Applications which are running in Access. But one of them crashes Access when its closed.

But only if either the VBE (The VBA-development-enviroment built into Access) is opened or the VBA-Code is accessed directly via automation (e.g. like this: Extract VBA-Code from Access via C# )

Any ideas where the problem might be or any tipps how to find the reason for the crash?

Gener4tor
  • 414
  • 3
  • 12
  • 40
  • If you don't have a clue why it crashes, I guess it's because the code is run on Open event. In this case, 1) Turn off Macros on your office. 2) Open the VBA code of the project crashing and put some strategic breakpoints 3) Re-enable macros 4) Get into the point crashing to have more tips. – Matteo NNZ Nov 26 '18 at 16:16
  • Possible duplicate of [How to diagnose MS access crashes](https://stackoverflow.com/questions/17279330/how-to-diagnose-ms-access-crashes) – Erik A Nov 26 '18 at 16:17
  • @Matteo NNZ: Ok, Ill try your suggestions – Gener4tor Nov 26 '18 at 16:19
  • @Erik von Asmuth: Thank you. Ill check the other question too – Gener4tor Nov 26 '18 at 16:20
  • @Mathieu Guindon: Yes I do run rubberduck. Ill check if my coworkers (they dont use Rubberduck) have the same problem. – Gener4tor Nov 26 '18 at 16:21
  • What version are you running? – Mathieu Guindon Nov 26 '18 at 16:23
  • 1
    It's also possible that you're *replicating* an issue that we closed in Rubberduck if you're running something similar to the [linked code](https://stackoverflow.com/q/50816715/4088852). Access is kind of touchy about having its document modules read from managed code via Interop. I'm pretty sure we have it documented on [this issue](https://github.com/rubberduck-vba/Rubberduck/issues/3614). – Comintern Nov 26 '18 at 16:38

1 Answers1

1

Earlier version of Rubberduck (prior to v2.2) are known to have teardown issues that caused the host application to crash with an access violation.

See if uninstalling Rubberduck updating Rubberduck to the latest version (we released v2.3 yesterday), fixes it.

As for a reason - Rubberduck is running in-process as a managed (.NET) library, constantly interoperating with the VBE's unmanaged/COM objects; until v2.2 we were running into issues with COM interop in .NET. These issues are resolved now.

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
  • ok, it seems to have worked. I didnt know that rubberduck is loaded when I just use the automation via interopt... – Gener4tor Nov 30 '18 at 08:18