Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Open MSWord errors

Posted on 2002-06-12
6
Medium Priority
?
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 400 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

650 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