Solved

SOLVED Vba error 49 "Bad DLL calling convention"

Posted on 2014-03-14
1
1,327 Views
Last Modified: 2014-03-14
This error caused me fits when my Outlook 2010 vba program called a function.  The function would work, and return the correct value but the "end function" command raised err 49 "Bad DLL calling convention".

Recompiling and rebooting did not fix the problem.  But any change to the function does solve the problem.  For instance,  a single extra space between  "end" and
"function"  was enough to solve the problem.  

Just to be on the safe side, I did a global change to both <end sub> and <end function>.

My code is now working again.

A a side note: I had earlier tried changing <a> to <a>  with match case = true then recompiled. That DOES NOT solve the problem.  Apparently vba was smart enough to notice that it did not really make any changes.  

Also, since I don't know what caused the error, I left the logic to alert me to future occurrences.
            on error resume next
            countImports = ImportClientYmail() 
            If Err = 49 Then Call msgFastBox(1107, "Minor error. Please tell Bob we are getting " & Error, 15000)
            On Error GoTo 0

Open in new window

The msgFastBox Shells to msgfastbox.exe  so the error message is asynchronous and does not interfere with further Outlook processing.
0
Comment
Question by:rberke
1 Comment
 
LVL 5

Accepted Solution

by:
rberke earned 0 total points
ID: 39930514
I am PAQing this because it is solved. I hope it helps some future researcher.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question