Results 1 to 2 of 2

Thread: Interface not registered error

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Location
    USA
    Posts
    3

    Interface not registered error

    Hi

    I am using this code and it was working fine. Now all of a sudden it gives me an error
    "Runtime error -2147221163
    Automation Error
    Interface not registered

    Does anyone know how to get rid of this error.

    This is the code. It is exporting data to MS WORD
    Dim oWord As Word.Application
    Dim oDoc As Word.Document
    Dim oTable As Word.Table
    Dim oPara1 As Word.Paragraph, oPara2 As Word.Paragraph
    Dim oPara3 As Word.Paragraph, oPara4 As Word.Paragraph
    Dim oFoot As Word.HeaderFooter
    Dim oRng As Word.Range
    Dim oShape As Word.InlineShape
    Dim Pos As Double

    'Start Word and open the document template.
    Set oWord = CreateObject("Word.Application") - error line
    oWord.Visible = True
    Set oDoc = oWord.Documents.Add

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    why are you late binding?

    if you declared all those object variables, then you must have set a reference to word already

    VB Code:
    1. Set oWord = New Word.Application

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width