GetObject and CreateObject NOT working UFT
Question ID: 107939
1
0

I was using below line of code with UFT 14 without any issues.

`——————————————————————————–
On Error Resume Next

Set oOutlook = GetObject( , "Outlook.Application")
On Error GoTo 0
If Not IsObject(oOutlook) Then
Set oOutlook = CreateObject("Outlook.Application")
End If
`——————————————————————————–

But since I’ve updated to UFT 14.01, it is not working. Here is the error messaged along with the ways that I’ve tried so far.

`——————————————————————————–
On Error Resume Next
"’File name or class name not found during Automation operation"
Set oOutlook = GetObject("C:\\Program Files (x86)\\Microsoft Office\\Office12\\OUTLOOK.EXE")

"’ActiveX component can’t create object"
Set oOutlook = GetObject( , "Outlook.Application")
On Error GoTo 0
If Not IsObject(oOutlook) Then
"’ActiveX component can’t create object: ‘Outlook.Application"’ IF OULTOOK IS OPEN
Set oOutlook = CreateObject("Outlook.Application")
End If
`——————————————————————————–

Please note, CreateObject is working if Outlook is closed.

Marked as spam
Posted by (Questions: 22, Answers: 6)
Asked on October 26, 2017 8:02 pm
448 views
Answers (1)
0
Private answer

If you have old version of UFT that works recommend comparing the permissions. Open UFT and Outlook together then compare the DEP, User Account Control (UAC), Elevated(not on all OS's).

To compare details:

1. Open Task Manger.
2. Go to Details tab.
3. Add the following fields (NOTE: not the same names for all OS's):
- DEP
- User Account Control (UAC)
- Elevated(not on all OS's)
4. Then compare the Outlook and UFT between machines.

UFT needs to be at the same or higher level than outlook.

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on October 26, 2017 8:02 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top