I'm currently trying to get my VB.net program to "SaveAs" a Excel Workbook, only to get Exception HRESULT : 0x800A03EC on the actual SaveAs line.
I checked my Filepath and it's fine and working, so I'm clueless at the moment
Here is my code where I declare Excel-related objects
Dim ExcelApp As New Interop.Excel.Application()
Dim Classeur = ExcelApp.Workbooks.Open("C:\Program Files (x86)\Software_name\template.xlsx")
Dim Feuille = Classeur.Sheets("sheet_name")
Then I declare values that I get from textboxes
Dim FileName As String = Textbox1.text + Textbox2.text + Textbox3.text
Dim FilePath As String = "\\192.168.1.xxx\some\folders\where\names\never\change\" & Date.Today.Year & "\" & FileName & "\"
MkDir(FilePath)
Dim StrPath As String = FilePath & FileName & ".xlsx" 'So I create a document named after FileName
And then I save with
'This works
Classeur.ActiveSheet.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, FilePath & FileName & ".pdf")
'This doesn't works
Classeur.SaveAs(StrPath)