Custom document properties via Excel AppleScript?

C

Cody Boisclair

I'm having trouble figuring out how to get the values for custom
document properties in Excel via AppleScript.

According to the dictionary, there is a class "custom document property"
which can be used to access these. However, I have opened a worksheet in
which I've defined several custom properties, and running the following
script:

tell application "Microsoft Excel"
get custom document properties of active workbook
end tell

gives the error message "The object you are trying to access does not
exist" rather than returning the expected properties.

Removing the "custom" from the script does return the built-in document
properties (though not the custom ones), so it doesn't appear to be an
issue of script syntax.

What, precisely, am I doing wrong here, or is this a bug in Excel?
 
C

Cody Boisclair

...running the following script:

tell application "Microsoft Excel"
get custom document properties of active workbook
end tell

gives the error message "The object you are trying to access does not
exist" rather than returning the expected properties.

This behavior happens, for the record, in Excel 2008. Excel 2004
doesn't give the error message, but it returns an empty value instead of
the expected collection of properties.
 
Top