(Solved) – Calling a PowerShell script from VBA not working from one directory only


I have a working VBA script that calls a Powershell script as follows:

Call Shell("powershell -executionpolicy bypass & """ & ThisWorkbook.Path & "FTPFTP.ps1""")

The actual workbook path is H:ABCTSVForecastWorksheets

If I move the workbook and the script to C:Test it executes the script just fine.

However, if I move the workbook and script to a synced location (SharePoint), it doesn’t execute the script. I’m wondering if the synced location’s file path is too long? The file path is 72 characters (e.g. C:UsersMyUsernameSharePointSiteSharePoint-LibraryForecastWorksheets).

Does anyone have any ideas how to get around this?

Leave a Reply

Your email address will not be published. Required fields are marked *