Solved

SOLVED Vba error 49 "Bad DLL calling convention"

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now