Error accessing external object property vbe

N

NilovSerge

Hi, All!
I wrote in client programm (PowerBuilder) some program in which I Ope
excel file from disc and I write
some VBA code in an Excel's sheet.
I did it so:
WEObject = Create OleObject
if WEObject.ConnectToNewObject("Excel.Application") = 0 THEN
...
WEObject.WorkBooks.Open(ExcelFileName)
...
WEObject.Application.VBE.CodePanes(1).CodeModule.InsertLines( 1,Re
)
It works FINE with Office97, 2000. But when I tried to run this progra
on
Office2003(11.5612.5606) I got the error:
" Message:Error accessing external object property vbe at line 236 in
function ...".
What is the matter ? Microsoft changed it's VBA object structure?
In Excel's Object Browser by searching "vbe" I see tham "vbe" is
member of
"Application" Object.
But when I tried to watch description of this object in low info windo
I
get error message "Cannot jump to
"VBE" because it is in the library "VBIDE" which is currentl
referenced"
In menu "Tools\References" I didn't found such a library?
Thanks in advance,
Nilov Serge
 
S

Stephen Bullen

Hi,
It works FINE with Office97, 2000. But when I tried to run this program
on
Office2003(11.5612.5606) I got the error:
" Message:Error accessing external object property vbe at line 236 in
function ...".
What is the matter ? Microsoft changed it's VBA object structure?

I imagine that this is because "Trust access to Visual Basic project" is
unticked in the Tools > Macro > Security dialog.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie
 

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