1

I would like to list all properties for an Excel Chart object, and I found a question with a solution: Get list of all properties for an object but it seems that this solution does not work on Windows 10 (and I think it does not work on Windows 7). The dll for TypeLib Information is apparently not compatible with Windows 10.

I use Office 2003, 2010 and 2013, and Windows 7 and 10. If you have a suggestion then please specify which version your suggested solution is tested on or expected to work on.

Community
  • 1
  • 1
Stefan
  • 622
  • 1
  • 5
  • 17

1 Answers1

0

I haven't found an answer for VBA, but in AutoIt it is possible to do something like this (requires that you select the first property in the Object browser (e.g. select Activate of the Chart object).

#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
Stefan
  • 622
  • 1
  • 5
  • 17