Scheduled Tasks often have difficulty launching GUI apps that expect desktop interaction. This isn’t really a PowerShell thing, unfortunately, it’s an interaction between Excel and the Task Scheduler and the way they both behave.
One of the many, many reasons I hate storing data in Excel.