在Windows 10中获取Excel对象的所有属性列表

我想列出一个Excel图表对象的所有属性,我发现一个解决scheme的问题: 获取一个对象的所有属性的列表,但似乎这个解决scheme不适用于Windows 10(我认为它不工作在Windows 7上)。 TypeLib信息的DLL显然与Windows 10不兼容。

我使用的是Office 2003,2013和2013以及Windows 7和10.如果您有build议,请指定您的build议解决scheme在哪个版本上进行testing或者预期可以使用。

我还没有findVBA的答案,但在AutoIt的自动化可以做这样的事情(要求您在对象浏览器中select第一个属性(例如select激活的图表对象)。

#include <GuiListBox.au3> _ReadItems() Func _ReadItems() const $delay=100 ;;get handle to Object Browser window $hwnd=WinWait("Microsoft Visual Basic - Book1 - [Object Browser]") ;;get handle to Object list box Local $hLB = ControlGetHandle($hwnd,"","[CLASS:ListBox; INSTANCE:3]") ;;get handle to "property information box" Local $hInfo= ControlGetHandle($hwnd,"","[CLASS:RichEdit20A; INSTANCE:1]") Local $sMsg = "" Local $text="" ;; loop through all items in list Local $iCnt =_GUICtrlListBox_GetCount ( $hLB ) For $n = 0 To $iCnt - 1 sleep($delay) ;;copy text in information box ControlFocus($hWnd, "",$hInfo) sleep($delay) send("^a") sleep($delay) send("^c") sleep($delay) $text= ClipGet() ;;move down in object list box send("+{TAB}") sleep($delay) send("{DOWN}") ;;add information to result string $sMsg &= $text & @CRLF Next ;;put result on clipboard ClipPut($sMsg) EndFunc ;==>_ReadItems