Solved

Open MSWord errors

Posted on 2002-06-12
6
180 Views
Last Modified: 2010-05-02
I have been using the following code to open msword.

'Try to get word object - ie. Word is open
Set MSWdApp = GetObject (, "Word.Application")

'Can't create ActiveX object - ie. Word NOT open
If Err.Number = 429 Then                
   'clear error
   Err.Clear      

   'Create word object
   Set MSWdApp = CreateObject("Word.Application")
End If

However sometimes on a new machine or clean install the
CreateObject("Word.Application") will fail for a number of reasons.

Some machines will say error "7 out of memory" and others will say error "-2423... automation error".

On these machines where the CreateObject fails, GetObject(, "Word.Application") will work.

BTW. I must have the word object late bound.

Can anyone shed some light on why the
CreateObject("Word.Application") would fail?
0
Comment
Question by:finster
  • 3
  • 2
6 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 100 total points
ID: 7074713
Hi finster,

what happens when you use it like

Dim objWord As Word.Application

    On Error Resume Next

    Set objWord = GetObject(, "Word.Application")
    If Err.Number = 429 Then
        Err.Clear
        Set objWord = CreateObject("Word.Application")
        If Err.Number = 429 Then
            'error out, word is not installed OR setup correctly.
        Else
            'success, word object is created.
        End If
    Else
        'success, existing word object is referenced.
    End If

this is very confusing

>>Some machines will say error "7 out of memory" and others will say error "-2423... automation error".
>>On these machines where the CreateObject fails, GetObject(, "Word.Application") will work

but why would you use create object when you already had the object in the getobject, that's a flaw in your logic because if getobject did work assigning a new object to the object already instanced will give you all kind of errors

HAGD:O)Bruintje
0
 
LVL 5

Expert Comment

by:rpai
ID: 7075668
Please maintain your open questions.
Questions Asked 75
Last 10 Grades Given A A A A A A A A A A  
Question Grading Record 70 Answers Graded / 70 Answers Received
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7271002
A request has been made (http://www.experts-exchange.com/Community_Support/CleanUp/Q_20351863.html) to delete this question.

Experts: please leave your thoughts here. No response will mean that the deletion will be granted.

Netminder
CS Moderator
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Expert Comment

by:bruintje
ID: 7273045
if the user wants to delete i want the solution we could eventually refund the points and move it to PAQ

but i don't spend thinkering on someone's problems especially when they're interesting to have them deleted with no feedback ;)
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7273519
bruintje,

I'm not terribly interested in deleting the question, and my natural disposition is to award the points if there's something close to a valid response. On the other hand, I'm no Expert in the subject, so I'm ready to believe you.

So: 1) PAQ/Refund? 2) PAQ/No Refund? 3) Award to XXX? 4) Delete?

Thanks,

Netminder
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7275950
Netminder thanks, give us 1

:O)Bruintje
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now