Hi @sem ,
I install Microsoft.Office.Interop.Excel on nuget package.
The following code works for me.
Imports Microsoft.Office.Interop
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim objApp As Excel.Application
Dim objBook As Excel.Workbook
Dim objSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
objApp = New Excel.Application
objBook = objApp.Workbooks.Add(misValue)
objSheet = CType(objBook.Sheets("Sheet1"), Excel.Worksheet)
' Do something...'
objSheet.Cells(2, 1) = "value"
Dim savePath As String = "your path"
objSheet.SaveAs(savePath)
objBook.Close()
objApp.Quit()
End Sub
End Class
Hope it could be helpful.
Best Regards,
Xingyu Zhao
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.