Export Excel workbook to CSV with special characters

Aleksandr Savenko -

$Sheet = "Sheet1"
$xls = "C:\test\Export2015.xlsx"
$csv = "C:\test\$Sheet.csv"
$objExcel = New-Object -ComObject Excel.Application
$objExcel.Visible = $False
$objExcel.DisplayAlerts = $False
$WorkBook = $objExcel.Workbooks.Open($xls)
$WorkSheet = $WorkBook.sheets.item("$Sheet")
$xlCSV = 6
$WorkBook.SaveAs($csv,$xlCSV)
$objExcel.quit()
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($objExcel)

Have more questions? Submit a request

Comments

Powered by Zendesk