Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SOLVED Vba error 49 "Bad DLL calling convention"

Posted on 2014-03-14
1
Medium Priority
?
1,638 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
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 …

773 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