Exceel Automation error, Invalid forward reference, or reference to uncompiled type.

Copper Contributor

I started having problems last Wednesday 12/13/12.   I have 2 spreadsheets that stopped running because of Automation error, Invalid forward reference, or reference to uncompiled type. and autosave.  I believe by turning off autosave in Excel fixed one problem.  But I am still getting Automation error, when I try to run the 2 spreadsheets above, I have tried change the VBA code, which makes matters worse. I have Win 11 Pro, Ver 23H2, 64-bit PC, Running Office 365 

2 Replies

@EdVagim 

Automation errors can be caused by various factors, and it's not uncommon for issues to arise after updates or changes in the software environment. Here are some steps you can take to troubleshoot and resolve the Automation error:

  1. Check for Windows and Office Updates:
    • Ensure that your Windows operating system and Microsoft Office applications are up to date. Sometimes, updating to the latest versions can resolve compatibility issues.
  2. Review Recent Changes:
    • Identify any recent changes or updates made to your system, Excel, or VBA code. This could include Windows updates, Office updates, or changes to your VBA code.
  3. Compile VBA Code:
    • Open the VBA editor (Alt + F11), go to Debug > Compile VBAProject. This will identify any syntax errors in your code. Fix any issues reported in the compilation process.
  4. Check References:
    • In the VBA editor, go to Tools > References. Make sure that all the required references are selected and that none are marked as "MISSING." If there are missing references, unselect them and then reselect the correct ones.
  5. Reset VBA Environment:
    • Close Excel and restart it. Open the VBA editor and compile your code again. Sometimes, restarting the application can resolve temporary issues.
  6. Test Code on Another Machine:
    • If possible, test your VBA code on another machine with a similar configuration. This can help determine if the issue is specific to your environment.
  7. Review Code for Changes:
    • Carefully review the VBA code that is causing the Automation error. Ensure that there are no undeclared variables, and check for any changes that might have introduced errors.
  8. Reinstall Office:
    • As a last resort, consider reinstalling Microsoft Office. This can help ensure that the installation is not corrupted.

Keep in mind that debugging VBA issues can be challenging, and it may require a combination of the above steps. Always make sure to back up your files before making significant changes to your environment. The text was created with the help of AI.

 

Otherwise you would have to have the VBA code and/or the VBA file (without sensitive data) to be able to say more precisely.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

 

Was the answer useful? Mark as best response and like it!

This will help all forum participants.

@NikolinoDE 

I just wanted you to know that I tried everything that you suggested, and I had pretty much given up.  But, one day the program started working again.  This was after my system crashed and would not restart.  So, I called Intel, and they suggested calling Microsoft to get my recovery key, which turned out to be 64 digits.  I keyed it in, and everything started to work again.  Even the VBA code that worked before started to work again.  I wasted a lot of time on this and like I said before I was ready to give up.  If appears, something had been corrupted, and by using recovery it straightened everything out. Also, all of the Automation errors have gone away.  I have been running for several days now, hopefully my issue is fixed and will not come back.

Thanks for the reply, Ed Vagim.