I have use this code
Controlling IE11 "Do you want to Open/Save" dialogue window buttons in VBA
But I get the error
"user defined type not defined"
on
Dim o As IUIAutomation
Someone knows how can I fix it?
I have use this code
Controlling IE11 "Do you want to Open/Save" dialogue window buttons in VBA
But I get the error
"user defined type not defined"
on
Dim o As IUIAutomation
Someone knows how can I fix it?
I guess you have to add a project reference to the UI Automation library. At least I could reproduce your error and fix it by adding the reference.
Add it using code
Public Sub AddReference()
ThisWorkbook.VBProject.References.AddFromFile
"C:\Windows\System32\UIAutomationCore.dll"
End Sub
and goto excel>>option>>Trust Center>>Trust Center Setting>>Macro setting and check on the Trust access to the VBA project object model