将Excel文件另存为CSV
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将Excel文件另存为CSV相关的知识,希望对你有一定的参考价值。
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:WindowsTemp mpCsvFromExcel.txt", xlCSVWindows ' Clean up objXlBook.Close True ' Save changes objXlApp.Quit ' Close Excel Set objXlBook = Nothing Set objXlApp = Nothing End Sub
以上是关于将Excel文件另存为CSV的主要内容,如果未能解决你的问题,请参考以下文章