Ensure that the first four selected (in order) items under
project>references are:
visual basic for applications
visual basic runtime objects and procedures
visual basic objects and procedures
OLE automation
If another control or class has defined a Right method, VB will require you
prefix with VBA.xxx in order to identify the particular Right method you
want to use. Ditto for the other control/classes Right method.
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Bo Wisén" <bo*****@telia.com> wrote in message
news:GT*****************@newsb.telia.net...
:
: "Olof Lagerkvist" <no@email.address> skrev i meddelandet
: news:YK*****************@newsb.telia.net...
: : Bo Wisin wrote:
: :
: : > Hi,
: : >
: : > A project in VB6 recently worked without any problems but now it's
: : > complaining when I try to use 'Right$'. In immediate mode, when I'm
: typing
: : > 'print left$("123456",2)' I get the correct result '12'. When I type
: 'print
: : > right$("123456",2) I expect the result '56' but all I get is an error
: 'type
: : > declaration does not match declared data type'. And I can't find that
I
: have
: : > tried to declare 'right'. Can anyone explain what can cause this
: problem?
: :
: : The problem may be that Right() is defined in another library referenced
: : in your project.
: :
: : Try to use the full object path to the Right() function, like:
: : Print VBA.Strings.Right("123456", 2)
: :
: : If you want to know where the other "Right" is defined, press F2 to open
: : the Object Browser and search for Right. It will show you all objects
: : where "Right" is defined.
: :
: : --
: : Olof Lagerkvist
: : ICQ: 724451
: : Web page:
http://here.is/olof
:
: Thanks!
:
: Writing 'Print VBA.Strings.Right("123456", 2)' works but looking in the
: object browser 'left' is defined in the library 'Unknown3' but 'right' is
: not defined at all! If I open a new project 'right' works. What could be
: done?
: / Bo
:
: