Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automation

Status
Not open for further replies.

bronc

Instructor
Aug 28, 2003
145
GB
If I write this code in an Excel Module and run it:

Option Explicit
Dim xl As Word.Application
Sub Import()
Set xl = New Word.Application

End Sub

I get:

"Run-time error '430'
Class does not support Automation or does not support expected interface."

The strange thing is that it runs OK on another machine. I have encountered this many times before. If I have a class of students, it works on most machines and not on some.

Rather than tell the students that I've got no idea,it would be useful to tell them why or better still fix it.

(Of course a reference is set to the Microsoft Word 11.0 Object Library. I have checked that they are identical versions.)
 
What happens if you replace this:
Set xl = New Word.Application
with this ?
Set xl = CreateObject("Word.Application")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
thanks
yes i tried that.
i think that's late binding.
i've been searching all over for an answer to this. it must be a common problem cause i get it often when i use different machines to teach on.
thanks again
 
Option Explicit
PUBLIC xl As Word.Application

Sub Import()
Set xl = New Word.Application

End Sub

although why you would use "xl" to refer to Word I have no idea ;-)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
nice thought but no luck.
same message
thanks tho

I'll try replacing xl with wrdApp
:)
 
DO some of your machines have 2000 on and others 2003 ?



Chance,

F, G + 1MSTG
 
No they are all 2003.

i think that i may have had the some problem (over the years!) with XP and 2000.
 
You may try to repair the office install.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I think that can happen if you install a newer version over an older version. Say, 2003 was installed on a box that used to have (or still has) 2000.

I found the following Knowledge Base articles by Googling for [google]Class does not support Automation or does not support expected interface site:microsoft.com[/google] (including "site:microsoft.com" returns only hits from that domain):

[tab]- BUG: VBA6 Extensibility Library Breaks Code Written for VBA5 Extensibility Library

[tab]- BUG: Interface methods in the VBA Extensibility Library (VBE) are changed

[tab]- PRB: Runtime Error 430 in Client After Server Type is Changed

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Code:
Sub CheckBindingLB()

    Dim wd As Object

    Set wd = CreateObject("Word.Application")

    MsgBox wd.Version
    
    wd.Visible = True
    
    
    Set wd = Nothing
    
    

End Sub

you can use the above to check the versions, and also see if the code runs on both machines

Chance,

F, G + 1MSTG
 
thanks a lot
i'll look thru all of that
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top