The error message "Object reference not set to an instance of an object" usually occurs when there is a problem with the Excel add-ins or the Excel settings. Here are some steps you can try to fix this issue:
- Disable all Excel add-ins: Open Excel in safe mode by pressing and holding the Ctrl key while opening Excel. Then go to File > Options > Add-ins. Select "Excel Add-ins" from the Manage drop-down list and click Go. Clear all the check boxes and click OK. Close Excel and restart it normally.
- Repair Office: Go to Control Panel > Programs and Features. Right-click on Microsoft Office 365 and select Change. Select "Quick Repair" and click Repair. Wait for the repair process to complete and then restart your computer.
If none of these steps work, you may need to uninstall and reinstall Office.