Permissions required to access Word.VBE.VBProjects collection

  • Thread starter Jason G. Ellsworth-Aults
  • Start date
J

Jason G. Ellsworth-Aults

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:

1 Dim objVBPrj, objVBCom, sMacro, lCount
2 sMacro = "\\ServerBlah\FileBlah.txt"
3
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...

Thanks,
Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top