maandag 14 december 2009

Save XLS File to CSV File (VB.net)

Private Sub SaveExcelFileAsCVSFile()

Dim excelfile As Microsoft.Office.Interop.Excel.Application =
New Microsoft.Office.Interop.Excel.Application
Dim sFileName As String
Dim wb As Workbook = excelfile.Workbooks.Open( _
"FILE.xls", CorruptLoad:=XlCorruptLoad.xlRepairFile)
sFileName = wb.Path & "\FILE.csv"
wb.SaveAs(sFileName, XlFileFormat.xlCSV, XlSaveAsAccessMode.xlNoChange)
wb.Close()
excelfile.Quit()

End Sub

Geen opmerkingen:

Een reactie posten