not a super strong powershell guy.I am trying to convert a CSV file to XLSX using Powershell. With the code below i can only save it as XLS not XLSX. If i put "$Workbook.SaveAs(“c:\sdk\AdEmployeeNumber.xlsX”,1)" excel thinks the file is corrupted.
$xl = new-object -comobject excel.application
$xl.visible = $true`enter code here`
$Workbook = $xl.workbooks.open(“c:\sdk\AdEmployeeNumber.csv”)
$Worksheets = $Workbooks.worksheets
$Workbook.SaveAs(“c:\sdk\AdEmployeeNumber.xls”,1)
$Workbook.Saved = $True
$xl.Quit()