I have a vbs file which calls a function from an xla addin to populate
a workbook.

When run normally it works fine.
However when run as a scheduled task (set to run with the same account)
it hangs at the following line:

Set wbMyAddin = appExcel.Workbooks.Open(AddIns("PI-AE").FullName)

Any idea whats causing this?