object invoked has disconnected from its clients

J

J. Clay

I have the following code:

'***** Code Start *******
Private Sub btnAttach_Click()
Dim objApp As Outlook.Application
Dim objSelItem As Object
Dim objSelection As Selection
Dim strName As String
Dim strOrigClass As String

Set objApp = CreateObject("Outlook.Application")
Set objSelection = objApp.ActiveExplorer.Selection

'***** Code End *******


On most of our machines this is working fine, but on any of our new machines
or machines that we are assigning to new users, I am getting an error on the
second Set command "Set objSelect = ojbApp.ActiveExplorer.Selection"

The error is:

Automation error
The object invoked has disconnected from its clients.

This is happening on both SP1 and SP2 machines.

Any suggestions?

TIA,
Jim
 
J

J. Clay

Discovered the solution (Thanks Sue Mosher) in another post. Instead of
using createobject, I set my AppOjb = Application to get the running app.

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top