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

Posted on 2006-03-31
Medium Priority
Last Modified: 2008-01-09
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.

Question by:jasonkneen
LVL 44

Expert Comment

ID: 16348986
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

Author Comment

ID: 16349112
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!

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 44

Expert Comment

ID: 16349159
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
LVL 44

Expert Comment

ID: 16583219
paq and refund

Accepted Solution

GranMod earned 0 total points
ID: 16656315
PAQed with points refunded (500)

Community Support Moderator

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question