Share via

Using Script to copy to multiple files in a folder

Anonymous
2023-08-24T23:12:03+00:00

I have a large number of files for individual clients that periodically need to be updated with the same new content. I am trying to create a script which loops through and opens each file within a specific folder and copies the content from a masterfile into each file held in the folder.

The files are saved in a sharepoint folder.

I am getting the following error

See line 8, column 7: Office Scripts cannot infer the data type of this variable. Please declare a type for the variable.

This is the line of code I have used

 let folder: ExcelScript.DirectoryObject = workbook.getDirectoryObjectFromUrl(folderUrl);

Microsoft 365 and Office | Excel | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-08-25T02:17:41+00:00

    Our category focus on excel function, we’d suggest you go to Microsoft Power Automate Community - Power Platform Community to post a new thread, which is the specific channel to handle Office script issue.

    Was this answer helpful?

    0 comments No comments