# IUIAutomation not defined



## peter2047 (Aug 30, 2018)

Hi All,

I am using Excel 2007. The following statement in Excel VBA is giving "User-defined type not defined" error message.
Dim AutomationObj As IUIAutomation

Does it mean that 2007 version do not support IUIAutomation ?

Thanks in advance.

PS. Windows 7 64-bit OS.


----------



## Jaafar Tribak (Aug 31, 2018)

peter2047 said:


> Hi All,
> 
> I am using Excel 2007. The following statement in Excel VBA is giving "User-defined type not defined" error message.
> Dim AutomationObj As IUIAutomation
> ...



That error suggests that your VBProject doesn't have a reference set to the UIAutopmationCore dll . Look under VBE/Tools /References.


----------



## peter2047 (Aug 31, 2018)

Thanks Jaafar.
The closest that I can see in the Tools-Reference is OLE Automation which is already selected.
I am looking for a way to click on "Save" in the Internet Explorer popup window.
If you have any link to an example is much appreciated.
Thanks.


----------



## Jaafar Tribak (Aug 31, 2018)

peter2047 said:


> Thanks Jaafar.
> The closest that I can see in the Tools-Reference is OLE Automation which is already selected.
> I am looking for a way to click on "Save" in the Internet Explorer popup window.
> If you have any link to an example is much appreciated.
> Thanks.



In the VBE, click on Tools/References and scrolldown till you find the entry that reads : UIAutomationClient , tick it and press OK.

If it is not on the list, click the browse button and goto the Windows\System32\ folder and choose the file UIAutomationCore.dll

As for clicking on "Save" in IE, I don't know the specifities of the page/button you want to click on.

Do a search on this forum and on other sites as this type question is asked frequently.


----------



## peter2047 (Sep 1, 2018)

Hi Jaafar,
I got it. Thank you very much.


----------



## peter2047 (Sep 2, 2018)

I got a message "Error in loading DLL". I give up using this.


----------



## peter2047 (Sep 2, 2018)

peter2047 said:


> I got a message "Error in loading DLL". I give up using this.



I never give up. 
Here is the solution on YouTube.
https://www.youtube.com/watch?v=6FjGjo-juic


----------



## Jaafar Tribak (Sep 2, 2018)

peter2047 said:


> I never give up.
> Here is the solution on YouTube.
> https://www.youtube.com/watch?v=6FjGjo-juic



Glad you had this sorted


----------

