'Exception calling "SaveAs" with "1" argument(s): "SaveAs method of Workbook class failed"'
Yet, you do not get this error when running the script from the PowerShell command line? Frustrating isn't it? Quit banging your head against your desk and make sure this path is valid via PowerShell.
Test-Path -path $env:windir\System32\config\systemprofile\DesktopIf the return from this command is "False", run the following to create the directory.
New-Item -path $env:windir\System32\config\systemprofile\Desktop -type Directory
No comments:
Post a Comment