0

I have this little script in VBA to fill fields with content type properties assigend on SharePoint.

Function SHAREPOINTPROPERTY(sPropertyName As String) As String
SHAREPOINTPROPERTY = Application.ThisWorkbook.ContentTypeProperties(sPropertyName)
End Function

This does not work, when i open files with Excel Online. For that reason I would like to convert this to a ExcelScript function which runs on open. Is this even possible and how would i approach this?

I've been looking at this but have not found much regarding my usecase.

BigBen
  • 46,229
  • 7
  • 24
  • 40
Benedikt
  • 41
  • 4
  • Could you share a bit more about what you're trying to achieve? Currently, Excel doesn't support automatically running an Office Script on workbook open, but Power Automate might be able to help you. – Michelle Ran Feb 02 '23 at 21:01
  • I set document properties of the file in Sharepoint (columns) and i want the values to be displayed in a cell of the workbook. Currently the only way i see to do this is with the VBA script but like that values are not displayed until someone opened it at least once in the desktop app. – Benedikt Feb 08 '23 at 08:35
  • Perhaps you could create a Power Automate flow that triggers when a file is modified in SharePoint, then pass the file properties into an Office Script that writes the values into a workbook? See https://learn.microsoft.com/en-us/connectors/sharepointonline/#when-a-file-is-created-or-modified-(properties-only) Happy to help with a more detailed solution if this seems to be the right direction for you. – Michelle Ran Feb 08 '23 at 18:08

0 Answers0