Forum Discussion

BartH_NL's avatar
BartH_NL
Copper Contributor
Aug 28, 2024

How to use a template file in VBA when it is stored online (Teams or SharePoint)?

As many companies are on the brink of migrating to Microsoft 365 and moving all files from the file server to the cloud (OneDrive/SharePoint), I need to know how I can use templates stored in Teams, from VBA.

Here is an example:
I have an Excel file in which I generate a chart, using a chart template with VBA.
This works fine as long the chart template is on a file server, but when I move it to Teams, my code can’t use the template.

so the template path is:

https://xxxxxxxxxxxxxx.sharepoint.com/sites/msteams_a046009/Shared%20Documents/General/DRR%20Test/DRR.crtx

(xxxxxxxxxxxxxxx = company id).

When I run the procedure, I get this error message:

How can I solve this?

 

GrtZ, BartH_NL

No RepliesBe the first to reply

Resources