Results 1 to 4 of 4

Thread: error loading Word 97 dll

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    5

    error loading Word 97 dll

    I am trying to export some calculations to a table in a Word document. When I run the following code, it works fine in Word 2003, but I get an error message when I run it on a computer using Word 97, although my References use Word 11.0 Object Library.

    The error message says that it is Runtime Error 48, Error Loading DLL.

    Here is the code:
    -----------------------------------------------------------------
    VB Code:
    1. Public Sub XYZ ()
    2.  
    3. Dim objWord as Object
    4. Dim objDoc As Object
    5.  
    6. Set objWord = CreateObject("word.application")
    7. Set objDoc = objWord.Documents.Add
    8.  
    9. objWord.Visible = True
    10. objDoc.Activate
    11.  
    12. With objDoc.ActiveWindow.Selection
    13.  
    14. objDoc.Tables.Add Range:=.Range, NumRows:=26, NumColumns _
    15. :=4
    16. .Tables(1).AutoFormat Format:=wdTableFormatSimple1, ApplyBorders _
    17. :=True, ApplyShading:=True, ApplyFont:=True, ApplyColor:=True, _
    18. ApplyHeadingRows:=True, ApplyLastRow:=True, ApplyFirstColumn:=True, _
    19. ApplyLastColumn:=False, AutoFit:=True
    20.  
    21. .SelectColumn
    22.  
    23. .Cells.SetWidth ColumnWidth:=InchesToPoints(2.5), RulerStyle:= _
    24. wdAdjustNone
    25. ...
    -----------------------------------------------------------------

    The error occurs on the last line ".Cells.SetWidth ColumnWidth:=InchesToPoints(2.5), RulerStyle:= _
    wdAdjustNone"

    All i am trying to do is to select this first column and change its width to 2.5", but i can't get this fixed.

    I sure would appreciate any help you could give me.
    I am trying to export some calculations to a table in a Word document. When I run the following code, it works fine in Word 2003, but I get an error message when I run it on a computer using Word 97, although my References use Word 11.0 Object Library.
    Last edited by RobDog888; May 7th, 2005 at 08:55 PM. Reason: Fixed the vbcode tag

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