1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
Dim xlApp As Microsoft.Office.Interop.Excel.Application = Nothing
Dim xlBook As Microsoft.Office.Interop.Excel.Workbook = Nothing
Dim oRien As Object = System.Reflection.Missing.Value
xlApp = New Microsoft.Office.Interop.Excel.Application()
'xlApp.Visible = False
Dim xlsFile As String = "C:\B_1.xls"
xlBook = xlApp.Workbooks.Open(xlsFile, 0, False, oRien, _
oRien, oRien, True, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, _
"\t", oRien, False, oRien, True)
Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet _
= xlBook.Worksheets("CODE_CONTENT")
Dim o As Object = "fred"
xlSheet.Cells(3, 1).value = o
'xlSheet.SaveAs(xlsFile, oRien, False, oRien, oRien, oRien, oRien, oRien, oRien)
xlBook.Save()
xlBook.Close(False, oRien, oRien)
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBook)
xlApp.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp) |
Partager