Reputation: 11
I'm trying to read Office document properties with VBA.
I get an error with DocumentProperty.Name with Office for Mac. This appears to be a change in version 16.27 (or so).
The code works on Windows.
On Mac the same error occurs for Word, Excel and PowerPoint (taking into account the ActiveDocument/Workbook/Presentation difference).
Sub ListDocProps()
Dim prop As DocumentProperty
Dim msg As String
For Each prop In ActiveDocument.BuiltInDocumentProperties
msg = msg & prop.Name
On Error Resume Next
msg = msg & prop.Value
Next
MsgBox msg, vbOKOnly
End Sub
I was expecting to see the property names, but I get the error message:
Invalid procedure call or argument
Upvotes: 1
Views: 73
Reputation: 11
I suspect that Microsoft thinks this was a bug. In a more recent build of Office, Version 16.29 (19081902), the problem has disappeared.
Thanks for reading, Sandy
Upvotes: 0