Solved

Open MSWord errors

Posted on 2002-06-12
6
181 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

786 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