Below I am unable to get this working in Excel 2010 under windows 7 as I am unable to set a reference to uiatuomatocore.dll.
Any suggestions to get this working from VBA
The easy (working) example in VBA (within Excel) under Windows XP with Automation API 3.0 installed (is XP + .NET 4)
the UIAutomationCore.DLL is an unmanaged DLL.
Sub test() ' uuid(30CBE57D-D9D0-452A-AB13-7AC5AC4825EE) interface IUIAutomation Dim c As New CUIAutomation 'reference to IUIautomation object Debug.Print c.GetRootElement.CurrentClassName 'Just to see if the basics work End Sub
Output of above will be #32768 (the desktop)