Solved

SOLVED Vba error 49 "Bad DLL calling convention"

Posted on 2014-03-14
1
1,372 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
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…

829 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