My Powershell (2.0) script has the following code snippet:
$fileName = \"c:\\reports\\1.xlsx\"
$xl = new-object -comobject excel.application
$xlFormat = [Mic
I think you've hit a bug in Excel:
You have to create a folder (or two on a 64bit-windows):
(32Bit, always)
C:\Windows\System32\config\systemprofile\Desktop
(64Bit)
C:\Windows\SysWOW64\config\systemprofile\Desktop
I have had the same problem and this was the only solution i have found.
From TechNet Forums (via PowerShell and Excel Issue when Automating )