Solved

SOLVED Vba error 49 "Bad DLL calling convention"

Posted on 2014-03-14
1
1,478 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

632 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