Original question posted to Office 365 forum.
I wanted to post that every time there is a Cumulative Update to Windows 10, I get a VS2019 program error when it attempts to programmatically open an Excel spreadsheet. I have to subsequently go into programs and Repair my installation of Microsoft 365. After doing the repair, the program runs normally.
Here is the statement it fails on.
Dim excelApp As Excel.Application = New Excel.Application With {
.Visible = True
}
Response from Office 365 forum.
Thank you for posting back and sharing the detailed information with us.
Considering you can directly open the Excel spreadsheet without any issue and the error message only appears when you use Visual Studio 2019 to open the spreadsheet, I'm afraid this issue may need to be investigated from Visual Studio's side.
In this situation, to make sure you get the dedicated assistance, I sincerely recommend you post the question in Q&A - Visual Studio Community, it is the specific channel handling this kind of issues, engineers and experts can help you check the code and assist you further.
In the meantime, I also tried to search for the error code you shared but cannot find similar threads which have same environment as yours. So I still recommend you ask the question in Q&A - Visual Studio Community, members will share specific suggestions based on the specific scenario on your side. I sincerely hope your question can be addressed by experienced assistance.
Your patience and understanding will be highly appreciated.
Have a nice day and stay safe.