I'm trying to create an Excel file in C# with Interop. I've created the basic formatting and was about to draw data from my SQL database but first wanted to be sure it works fine.

Every time I try to save the file, I get the general

Exception from HRESULT: 0x800A03EC

message. I've searched far and wide for a solution and tried everything I can but I can't seem to get it to work. It gives me an error message when it reaches the SaveAs line.

Below is my code for the void function that creates the Excel file: