K
kuhni
Hi All,
I've a very strange problem, but I can't sort it out so I hope that
somebody of you has the clue!
In a given workbook, in let's say "Module1", I want to get the name of
the "Module2" (just to make a very simple case). So I use the following
code:
Sub test()
Debug.Print Application.VBE.ActiveVBProject. _
VBComponents("Module2").Name
End Sub
When running this one-liner, I get an error 1004:
"1004: Method 'VBE' of object '_Application' failed"
I'm using Excel 2003 and I have the macro security set to low (not
recommended) as well as the reference "Microsoft Visual Basic for
Applications Extensibility 5.3" included.
Any ideas where the problem could be?
MANY THANKS FOR YOUR HELP!
Cheers
Kuhni
I've a very strange problem, but I can't sort it out so I hope that
somebody of you has the clue!
In a given workbook, in let's say "Module1", I want to get the name of
the "Module2" (just to make a very simple case). So I use the following
code:
Sub test()
Debug.Print Application.VBE.ActiveVBProject. _
VBComponents("Module2").Name
End Sub
When running this one-liner, I get an error 1004:
"1004: Method 'VBE' of object '_Application' failed"
I'm using Excel 2003 and I have the macro security set to low (not
recommended) as well as the reference "Microsoft Visual Basic for
Applications Extensibility 5.3" included.
Any ideas where the problem could be?
MANY THANKS FOR YOUR HELP!
Cheers
Kuhni