Powershell with excel interop is saving to some random file. Here are few lines:
$outputExcelFile = Join-Path -Path $outputExcelFolder -ChildPath "$($fileName).xlsx"
Write-Host "Saving file $outputExcelFile ..."
$outputExcel.SaveAs($outputExcelFile)
On my Windows 10 it is saving just fine. On another PC error is happening:
Saving file C:\files\myexcel.xlsx Microsoft Excel cannot access the file 'C:\files\8142AA10'. There are several possible reasons:
- The file name or path does not exist.
- The file is being used by another program.
- The workbook you are trying to save has the same name as a currently open workbook.
What is 8142AA10?!! You can see variable name to save holds C:\files\myexcel.xlsx.
Any suggestions?