Link to home
Start Free TrialLog in
Avatar of jasonkneen
jasonkneen

asked on

Can't invoke createobject("outlook.application") unless I use createobject("outlook.application","localhost")

I have a new laptop and am having a problem I didn't have previously.

Within a custom form I'm trying

Set oOutlook = createobject("outlook.application")

and it generates an exception.

If I change it to

Set oOutlook = createobject("outlook.application","localhost")

it works.

I've never had to do this before on other machines.

I get a similar problem with VB6. If I add in the Outlook 11 library and try

set oOutlook = new Outlook.application

I get an error

If I change it to

set oOutlook = createobject("outlook.application","localhost")

It works.


Hello jasonkneen,

this could've to do with a script blocker in AV software which requires explicit direction [localhost in this case] to the on the caller of create object

hope this helps a bit
bruintje
Avatar of jasonkneen

ASKER

I've solved this. The solution was to uninstall office then reinstall - repair did not work.

I'm not sure what the exact problem but it sounds like Outlook wasn't registered properly as an application server. Invoking "word.application" worked but outlook wouldn't unless the "localhost" server was specified.

Not only is my script problem solved but google desktop now shows outlook messages, something it didn't do before so as I thought - the two issues were linked.

Anyway, solution is complete reinstall of office!

Jason
glad you solved it :)
after reading your comment it looks like a registry issue indeed, would be interesting to kn ow when it started happening maybe an update or something
paq and refund
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial