Results 1 to 4 of 4

Thread: error loading Word 97 dll

  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

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: error loading Word 97 dll

    Since you are Late Binding your objects you shouldnt need a Word reference. Are you leaving the reference when you compile/package
    and deploy to the 97 system?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    5

    Re: error loading Word 97 dll

    i haven't gotten so far as compiling or packaging it yet

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: error loading Word 97 dll

    On the system with Word 97, in the VB IDE uncheck the reference to MS Word 11.0 and click ok. Then add a reference to MS Word 8.0.
    Although since your using late binding all you should have to do is remove the reference to Word completely.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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