You can use an OLEDB connection to update the spreadsheet. Then you could do the following to print it:
Dim strFile As String = "c:\test.xls"
Dim objProcess As New System.Diagnostics.ProcessStartInfo
With objProcess
.FileName = strFile
.WindowStyle = ProcessWindowStyle.Hidden
.Verb = "print"
.CreateNoWindow = True
.UseShellExecute = True
End With
Try
System.Diagnostics.Process.Start(objProcess)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
After it is printed you could do a simple System.Diagnostics.Process.Start("c:\test.xls")
to open the workbook for the user to view.
Alternatively, you could use an OLEDB connection to update the spreadsheet. Then you could open it via interop with something like this. You can also input the strings into the workbook at the same time (and not use the OLEDB connection). Add a reference to Microsoft.Office.Interop.Excel.
Imports Microsoft.Office.Interop
Public Class MyExcel
Private Sub StartExcel()
Dim xlApp As New Excel.Application
xlApp.Visible = True
Dim xlBook As Excel.Workbook = xlApp.Workbooks.Open("c:\test.xlsx")
Dim xlSheet As Excel.Worksheet = xlBook.ActiveSheet
Dim xlSheet2 As Excel.Worksheet = xlBook.Worksheets("Sheet 3")
xlSheet2.Range("B5").Value2 = "my new string"
xlSheet.Range("A1").Value2 = "my string"
xlBook.PrintPreview()
End Sub
End Class