Solved

Open MSWord errors

Posted on 2002-06-12
6
179 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

708 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

19 Experts available now in Live!

Get 1:1 Help Now