Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jun 2004
    Thanked 0 Times in 0 Posts

    Permission to Word.VBE.VBProjects (Word 2000)

    I am doing some Word 2000 automation from an IE-based intranet
    application. My problem lies in a section of the appliction where I
    grab a template of macro code from a text file on the server that I
    want to insert into my Word document before opening it for editing for
    the user. The VBScript code looks like this:
    <pre> 1 Dim objVBPrj, objVBCom, sMacro, lCount
    2 sMacro = "BlahBlahfoo.txt"
    4 For Each objVBPrj In objWord.VBE.VBProjects
    5 If objVBPrj.Name = "TemplateProject" Then
    6 For Each objVBCom In objVBPrj.VBComponents
    7 If objVBCom.Name = "NewMacros" Then
    8 lCount = objVBCom.CodeModule.CountOfLines
    9 objVBCom.CodeModule.DeleteLines 1, lCount
    10 objVBCom.CodeModule.AddFromFile sMacro
    11 End If
    12 Next
    13 End If
    14 Next

    If the user is not running as an Administrator, it throws an error
    at line 4. The error is "'vbe6ext.olb' could not be loaded." If, on
    the other hand, the user is a local admin, everything runs fine.

    If anyone has an idea what I can do to fix this that does not
    involve making the user a local admin, please let me know...


  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    New York, New York, Lebanon
    Thanked 1 Time in 1 Post

    Re: Permission to Word.VBE.VBProjects (Word 2000)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Jason

    I think you may have to manually set a reference to the VBE6EXT.OLB. Try this and come back to us and give us an update.

    The VBE6EXT.OLB is an Object Library file, and you should have it installed and activated before you can use the objects it hold.

    Your code is looking for objects, and it just maybe that the reference is set for the Admin. account but not all user accounts.

    Hope this helps.

    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

Posting Permissions

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