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

Jamie Garroch
Jamie Garroch used Ask the Experts™
on
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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014

Commented:
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 BrightCarbon

Author

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 :-(
Most Valuable Expert 2012
Top Expert 2014

Commented:
Sorry ... good luck in the hunt!
Senior Technical Consultant at BrightCarbon
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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial