System Error &H8000FFF (-2147418113)

I have an Excel workbook that I've been working on both at work on my work laptop and at home on my home laptop. The work book has some VBA code and user forms. Until earlier this week, the workbook was functioning just fine at work and and home. On Wednesday, Excel crashed on my work laptop then restarted. Luckily I had a recent saved copy so I re-opened the last good saved copy of the Workbook. Now however, the file no longer opens on my home laptop (but still works fine on my work laptop). On my home laptop I get the message System Error &H8000FFF (-2147418113). If I try to run any of the VBA code, i get the message Compile Error Out of memory; but I have plenty of available memory. I have uninstalled all versions of Office from my laptop and only installed Office 2016.

I'm pulling my hair out trying to understand why it no longer works on one laptop, but it does on others? Any suggestions?

Many thanks.

The error can be the result of something not loaded at the time that the code runs. Do you have "Workbook_Open" event code in ThisWorkbook? If so, Change the name of the event so it will not run on open and see what happens.

If above allows the workbook to open then after the workbook opens, run the Workbook_Open code. (You can just open the module and click anywhere in the sub and press F5 and it will run)

It is possible that you have code in the Workbook Open event that is supposed to load something that is not getting loaded fast enough before other code runs that relies on the object being loaded (eg. if a userform is supposed to load and then you are running code to populate a combobox rowsource or list). If your computer at home does not run as fast as the work computer then this can explain the reason for this. You can force code to finish running before following code runs by inserting a line DoEvents and that allows it to "Catch up" before running further code.

Do you use Option Explicit? If not then let me know and I will give you some guidelines on using it.

Regards,

OssieMac

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Hi OssieMac,

Thanks so much for the advice. I don't actually have a Workbook_Open event. There's a couple of User Forms (one is a calendar and the other is a simple user form; let's call it Toolbox; the calendar is called from the Toolbox). The Toolbox user form is only called when the user selects a separate button from a worksheet.

I have used Option Explicit before but perhaps not fully understanding what it does. I noticed I hadn't used Option Explicit consistently so on the Module or Userform pages where I hadn't used it, I wrote it in then re-ran the Userform.show command. This time it actually highlighted a possibly Set error which I've also corrected. If you could offer some further advice on Option Explicit, I'd be most grateful.

My home laptop had a slightly earlier build version of Office. I've since updated my home laptop so that both now have Office 365: version 1701 (Build 7766.2060). The only difference my work laptop is 365Business and my home laptop is 365ProPlus - shouldn't make a difference?

Regards Corin.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

If you could offer some further advice on Option Explicit, I'd be most grateful.

Hello Corin,

Basically Option Explicit says that all variables in the code must be declared (ie. Dim statements).

The single biggest advantage that I see with using it is that if Debug -> Compile is used before running any code then it will stop on any variable that is not declared and in my case it is usually a misspelt variable name. (I still can't find a keyboard that types what I meant to type instead of what I did type)

Copy the following simple example into a module in new workbook. Initially run the code with Option Explicit commented out.  (If you already had Option Explicit at the top of the module then delete it). The MsgBox returns "No value assigned to strMyText" when the lines of code immediately above assigned a value to it. This is because the If statement has the variable misspelt and the misspelt variable becomes a new variable and does not show up as an error. Problems like this are very hard to diagnose because the code can go ahead and process the data incorrectly and return the incorrect results and it is hard to determine why it is not working properly.

Now uncomment the Option Explicit and re-run the code and you will get an error. The variable will be highlighted  on the If statement line and a message telling you that the variable is not defined.

Also, before running the code, you can use Debug -> Compile and it will find the error before running the code. This will also find any object like a TextBox or ComboBox control that is misspelt.

'Option Explicit      'Initially leave commented out.

Sub Test()

    Dim strMyText As String
   
    With Worksheets("Sheet1")
        strMyText = .Cells(2, "A").Value
    End With
   
    If strMyTest = "" Then      'Variable is misspelt
        MsgBox "No value assigned to strMyText"
    Else
        MsgBox "strMytext = " & strMyText
    End If

End Sub

Regards,

OssieMac

1 person was helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

 
 

Question Info


Last updated August 5, 2020 Views 5,958 Applies to: