ti potrebbe servire per altri impieghi, questo è un esempio di codice per creare un file excel
codice:
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
Dim nomefile As String
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add
oSheet = oBook.Worksheets(1)
oSheet.Range("A1").Value = A1_txt.Text
oSheet.Range("B1").Value = B1_txt.Text
oSheet.Range("A2").Value = A2_txt.Text
oSheet.Range("B2").Value = B2_txt.Text
nomefile = nome_txt.Text
Try
oBook.SaveAs("F:\Download\" + nomefile + ".xlsx") ' percorso da modificare
oExcel.Quit()
MsgBox("File Excel creato con successo", MsgBoxStyle.Information, "Notifica")
Catch
oBook.Close(False)
oExcel.Quit()
MsgBox("Percorso non trovato", MsgBoxStyle.Information, "Notifica")
End Try