Nick:
One thing to look at is the "VBAProject" portion of your line of code. If
this does not reference a VBA project, you will get a subscript out of range
error. The "VBAProject" portion should refer to the name of the database
name you are trying to add the reference to.
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or warranties.
"Nick Douglas" <ni*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Hello,
I'd like to programmatically reference the Excel Object Library from an
Access form using VB. I am using this code:
Application.VBE.vbprojects("VBAProject").Reference s.AddFromFile "(file
location)"
....but get a 'subscript out of range' message. Can anyone help?
Thanks