VBA System Error &H8000FFFF (-2147418113). Catastrophic failure

I have a VBA add-in that works fine on lots of different Windows PCs.

Recently, several users reported that the add-in shows the following message numerous times, one after another, when trying to load either as an application add-in file or via the source macro-enabled Office file:

System Error &H8000FFFF (-2147418113). Catastrophic failure

Microsoft's help page that this message links to simply states "Visual Basic encountered an error that was generated by the system or an external component."!

After repeatedly clicking OK or or holding the Enter key to dismiss this repeating message, the following message is eventually displayed:

Compiler error. Out of memory.

I have issolated it to a specific model of Dell XPS laptop but they are well spec'd with Windows 10 Pro 64 bit, 16GB RAM and 2.2 GHz Intel Core i7.

The project has many modules/userforms/classes so it's not possible to post all of the code here, or even easily issolate where it's going wrong due to the nature of the error messages and behaviour of VBE after dismissing them.

Once out of the error message loop above, the following text in bold is highlighed in a code moule window:

Optional ByVal CompareMode As VbCompareMethod = vbTextCompare, _

Public Function QSortInPlace( _
    ByRef InputArray As Variant, _
    Optional ByVal LB As Long = -1&, _
    Optional ByVal UB As Long = -1&, _
    Optional ByVal Descending As Boolean = False, _
    Optional ByVal CompareMode As VbCompareMethod = vbTextCompare, _
    Optional ByVal NoAlerts As Boolean = False, _
    Optional ByVal tSeparator As String = "") As Boolean

Open in new window


Given the compexity of the project, how can I proceed in working out what is wrong?
LVL 16
Jamie GarrochSenior Technical Consultant at BrightCarbonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Does this happen on all the Dell laptops you identified?

Your declaration seems odd. I'd think your CompareMode should be defined "As Integer" or something of that nature, and then you'd set the value to vbTextCompare.

Public Function QSortInPlace( _
    ByRef InputArray As Variant, _
    Optional ByVal LB As Long = -1&, _
    Optional ByVal UB As Long = -1&, _
    Optional ByVal Descending As Boolean = False, _
    Optional ByVal CompareMode As Integer= vbTextCompare, _
    Optional ByVal NoAlerts As Boolean = False, _
    Optional ByVal tSeparator As String = "") As Boolean
Jamie GarrochSenior Technical Consultant at BrightCarbonAuthor Commented:
Hi and thanks Scott.

It's been identified as an issue with 4 of the 7 users with this model so far and I'm waiting to hear back from the other 3. I think what the VBE is actually indicating after many many instances of this error message might be a steer in the wrong direction. It's not highlighting the statement in yellow, just that one word in blue (but I guess the compiler has given up after the memory message). And the code for that procedure is coming from a very reputable source:

http://www.cpearson.com/excel/SortingArraysOfObjects.htm

You can also see the VbCompareMethod enumeration pop up in IntelliSense as you type this test declaration:

Sub test(x As VbCompareMethod)
   x = vbTextCompare
End Sub

Open in new window


Having done a lot of reading online it looks like this rather generic error (!) might be indication some sort of corruption with one of the 50 or so userforms in the project. I have a userform to export all modules+userforms+classes and reimport them and will test this as a way of rebuilding the project. Another post indicated that if this doesn't work, the userform in question (which ever one it is I have no idea yet) would need rebuilding manually from scratch. Groan! Some of them are extremely complex with custom controls :-(
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Sorry ... good luck in the hunt!
Jamie GarrochSenior Technical Consultant at BrightCarbonAuthor Commented:
The problem has finally been identified!

The issue is caused by the use of a custom mouse icon on a userform control using the MouseIcon and MousePointer properties. Deleting the custom icon from the MouseIcon property and changing the MousePointer property from fmMousePointerCustom to anything else fixed the problem.

But because this was machine dependant I suspect this is some kind of Microsoft bug and have reported it as such.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.