Bad DLL calling convention

bad dll

Anyone ever got that in a pure VBA system?

I’ve seen it when using dlls and trying to pass byRef when the dll wants it byVal. (well in fact in most of the cases mentioned here). But I don’t recall seeing it in a pure VBA project that isn’t using dlls (or non standard references).

Anyway Codecleaner fixed it (Thanks Rob)

I always worry though, that something deep inside may be going horribly wrong quietly.

I couldn’t get the code to break on the problem line, it just seemed to get upset returning from a function call.

I very rarely have problems with VBA, but there are one or two projects I look after that throw freaky errors quite regularly. How about you?



5 Responses to “Bad DLL calling convention”

  1. Rob Bruce Says:

    I get plenty of spurious ‘Duplicate Declaration In Current Scope’ errors. This obviously stops the code dead and I have to close and reopen the workbook at least, though it makes sense to run CodeCleaner.

    I did have one VB6 project that contained a phantom persistent breakpoint that I could never get rid of. I never worked out how it could possibly persist across compiles even after I cleared out all temp files.

  2. Simon Says:

    I don’t think I have ever seen that first one, but I have had the zombie breakpoints.

  3. Marcus Says:

    Yup, had this too but only rarely. Usually when a spreadsheet was about to crap out (technical term) from being compiled too many times. The Export/Import objects has typically fixed it. The only expectation was a form with a corrupted third party ocx which wouldn’t export. Had to resort to a back up copy for that object. Funny, the Export/Import usually fixes those phantom break points too.

  4. Chris Says:

    My personal favourite was “the object involved has disconnected from its clients”, which I got fairly regularly on one of my workbooks. Or the enigmatic “automation error”…

  5. Colin Says:

    I got hit by the Bad DLL calling convention error today, in a pure VBA project. Codecleaner sorted it out for me too…

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: