I have a VB.Net windows forms application which is working fine in windows 7 environment.
Now, I want to upgrade to windows 10. So I have started to test my application in windows 10 server machine.
I am getting an Exception
(Exception from HRESULT:0X800A03EC) while saving a dynamically generated file in one of the folders on server.
I have identified the issue is not with the permissions.
'getting exception at this line of code.
xlApp.Workbooks(1).SaveAs(filename , xl.XlFileFormat.xlHtml)
Code for reference:
Private Sub VierwInBrowser(ByVal xlApp As xl.Application)
Dim fileName As String = String.Format("{0}\{1}", "C:\Data", GetUniqueFileName())
Try
xlApp.Workbooks(1).SaveAs(fileName, xl.XlFileFormat.xlHtml)
Catch ex as Exception
Messagebox.Show(ex.Message)
End Try
xlApp.Quit()
xlApp = Nothing
GC.Collect()
browser.Visible = True
browser.Navigate(fileName)
browser.BringToFront()
End Sub