Forum Discussion
Karinh395
Jan 29, 2024Copper Contributor
Microsoft Visual Basic for Applications System Error &H8000FFFF (-2147418133). Catastrophic failure.
Hi All: I created a spreadsheet with the following VBA: Function SumColor(MatchColor As Range, sumRange As Range) As Double Dim cell As Range Dim myColor As Long myColor = MatchColor.Cells(...
smylbugti222gmailcom
Jan 31, 2024Iron Contributor
The "Microsoft Visual Basic for Applications System Error &H8000FFFF (-2147418133). Catastrophic failure." error you're encountering can be frustrating, but there are a few reasons it might be happening in your specific case. Here are some things to try:
1. Check for "Workbook_Open" event code:
- Open the VBA editor (Alt + F11).
- In the Project Explorer, expand your workbook and look for a module named "ThisWorkbook."
- Double-click "ThisWorkbook."
- Check if there's any code in the "Workbook_Open" event procedure.
- If there is, try commenting it out (adding ' in front of each line) or deleting it. Sometimes rogue code in this event can trigger errors when opening the workbook.
2. Verify references:
- Go to Tools > References in the VBA editor.
- Look for any unfamiliar or unnecessary references listed.
- Try unchecking those references and see if the error persists. Sometimes unexpected references can cause crashes.
3. Clear compiled code:
- Go to Tools > VBAProject Properties.
- Select the "Compile" tab.
- Click the "Clean" button under "Compile options."
- This will clear any cached compiled code and force it to be rebuilt next time you run the macro.
4. Debug the code:
- Set breakpoints within your "SumColor" function at key points like the loop or conditional statement.
- Run the macro in step-by-step mode (F8 key) and see if you can identify any suspicious behavior or errors within the code.
5. Consider alternative approaches:
- If the function only needs to check the first cell in "MatchColor" for color, consider simplifying the code by directly comparing the color instead of looping through cells.
- You can also explore using built-in Excel functions like SUMIF or SUMPRODUCT that might achieve the same result without needing custom VBA.
Additional Tips:
- Make sure you have the latest updates installed for both Excel and VBA.
- Try opening the workbook in Safe Mode (holding Ctrl while opening Excel) to see if any add-ins are causing the issue.
- If none of these suggestions work, consider sharing the full code of your "SumColor" function and any other relevant VBA code for further analysis.
Remember, troubleshooting VBA errors can be tricky, but by testing and analyzing different possibilities, you should be able to pinpoint the cause and fix the problem.
I hope this helps!
Karinh395
Feb 08, 2024Copper Contributor
Hi All:
Thanks for the information above. Maybe there is an easier way to get the color situation done without using VBA? My document can be sorted for individual managers and they want the information color coded. Each item is color coded for the year in which the event happened. Which means that I have 8 colors (deposits 4 and EF Reminder 4) . Please let me know if you have any ideas.
Deposit Date Deposit EF Date EF Remainder
03/23/2022 $8,928.00 04/01/2022 $80,352.00
01/24/2022 $10,340.00 03/24/2022 $93,059.00
06/14/2022 $12,876.00 09/08/2022 $176,396.00
04/01/2022 $10,340.00 07/12/2022 $93,059.00
03/24/2021 $32,124.00 07/29/2023 $96,632.00
08/17/2022 $10,340.00 09/09/2022 $93,059.00
08/24/2022 $10,340.00 11/21/2022 $103,399.00
12/07/2022 $17,700.00 12/20/2022 $150,446.00
11/07/2022 $15,200.00 12/14/2022 $136,796.00
01/31/2023 $12,321.00 04/17/2023 $126,418.00
04/14/2023 $9,821.00 04/24/2023 $88,387.00
05/02/2023 $8,790.00 05/17/2023 $79,114.00
04/18/2023 $10,681.00 06/02/2023 $96,132.00
07/03/2023 $11,374.00 07/27/2023 $102,365.00
09/18/2023 $11,374.00 10/31/2023 $102,365.00
07/28/2023 $16,720.00 12/01/2023 $150,476.00
12/21/2023 $19,779.00
2021 2021
2022 2022
2023 2023
2024 2024
2025 2025
2026 2026
2027 2027
2028 2028
2029 2029
2030 2030
Thanks for the information above. Maybe there is an easier way to get the color situation done without using VBA? My document can be sorted for individual managers and they want the information color coded. Each item is color coded for the year in which the event happened. Which means that I have 8 colors (deposits 4 and EF Reminder 4) . Please let me know if you have any ideas.
Deposit Date Deposit EF Date EF Remainder
03/23/2022 $8,928.00 04/01/2022 $80,352.00
01/24/2022 $10,340.00 03/24/2022 $93,059.00
06/14/2022 $12,876.00 09/08/2022 $176,396.00
04/01/2022 $10,340.00 07/12/2022 $93,059.00
03/24/2021 $32,124.00 07/29/2023 $96,632.00
08/17/2022 $10,340.00 09/09/2022 $93,059.00
08/24/2022 $10,340.00 11/21/2022 $103,399.00
12/07/2022 $17,700.00 12/20/2022 $150,446.00
11/07/2022 $15,200.00 12/14/2022 $136,796.00
01/31/2023 $12,321.00 04/17/2023 $126,418.00
04/14/2023 $9,821.00 04/24/2023 $88,387.00
05/02/2023 $8,790.00 05/17/2023 $79,114.00
04/18/2023 $10,681.00 06/02/2023 $96,132.00
07/03/2023 $11,374.00 07/27/2023 $102,365.00
09/18/2023 $11,374.00 10/31/2023 $102,365.00
07/28/2023 $16,720.00 12/01/2023 $150,476.00
12/21/2023 $19,779.00
2021 2021
2022 2022
2023 2023
2024 2024
2025 2025
2026 2026
2027 2027
2028 2028
2029 2029
2030 2030