/ Published in: Visual Basic

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Sub saveExcelAsCsv(ExcelFileName As String) Dim objXlApp As New Excel.Application Dim objXlBook As Excel.Workbook ' Setup the Excel Workbook to save Set objXlBook = Excel.Workbooks.Open(ExcelFileName) ' Save the Excel file as a CSV file in a temp location objXlBook.SaveAs "c:\Windows\Temp\tmpCsvFromExcel.txt", xlCSVWindows ' Clean up objXlBook.Close True ' Save changes objXlApp.Quit ' Close Excel Set objXlBook = Nothing Set objXlApp = Nothing End Sub
Comments
