Forum Discussion
rich_russell
Sep 26, 2023Copper Contributor
How to open an Excel workbook from Sharepoint folder, with credentials
I've got a Powershell script that successfully opens and reads an Excel workbook which is stored in a Sharepoint folder, BUT when I set it up to run under Task Scheduler it fails. Note that when I ...
rich_russell
Sep 26, 2023Copper Contributor
Not to my knowledge. And if it were, wouldn't that prohibit the script from successfully accessing the workbook when I run it from the PS command prompt?
Thanks for any insight--conditional access policies and MFA are not something I'm familiar with.
Thanks for any insight--conditional access policies and MFA are not something I'm familiar with.
Sep 26, 2023
To see what's going on, you could use "Start-Transcript c:\temp\log.txt" as the first line in your script and Stop-Transcript as the last line. You will see all the script output in the log, and perhaps it will show you more information when running it as a Scheduled Task.
- rich_russellSep 26, 2023Copper ContributorI did that, actually (ironically, I had *literally* named the log file "c:\temp\log.txt" but left it out of my sample code in an effort to stick to the key point. That log shows that the script runs normally right up to the line $Workbook = $Excel.Workbooks.Open() ... and then hangs indefinitely.
Thank you for your suggestions and input!