Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Dec 2009
    Location
    Bogangar NSW Australia
    Posts
    105
    Thanks
    25
    Thanked 2 Times in 2 Posts

    VB 2010 Express: Right() and IsObject() build errors

    The image below is screenshot of some Visual Basic 2010 Express Code that keeps giving me an error message for the Right() and IsObject() functions.

    The error messages I'm getting are:
    • Right(objFile.name,3): "'Public ReadOnly Property Right As Integer' has no parameters and its return type cannot be indexed"
    • IsObject((objOldestFile): "'isobject' is not declared. It may be inaccessible due to its protection level."
    I googled extensively but haven't worked out why these functions are not working. Anyone got any clues I can follow up?

    Thanks is anticipation of a guidance or a solution.

    Cheers

    Trevor
    20120704 VB Right & IsObject Errors.JPG

  2. #2
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Redditch, Worcestershire, England
    Posts
    221
    Thanks
    0
    Thanked 21 Times in 20 Posts
    Quote Originally Posted by BygAuldByrd View Post
    The image below is screenshot of some Visual Basic 2010 Express Code that keeps giving me an error message for the Right() and IsObject() functions.

    The error messages I'm getting are:
    • Right(objFile.name,3): "'Public ReadOnly Property Right As Integer' has no parameters and its return type cannot be indexed"
    • IsObject((objOldestFile): "'isobject' is not declared. It may be inaccessible due to its protection level."
    I googled extensively but haven't worked out why these functions are not working. Anyone got any clues I can follow up?

    Thanks is anticipation of a guidance or a solution.

    Cheers

    Trevor
    20120704 VB Right & IsObject Errors.JPG
    I'm not familiar with IsObject, but as far as Right is concerned I have a feeling that because it's a property of lots of objects you can't simply use its name as you can in VBA for example when you want to use it as a function - you have to use a fully qualified version like this:

    strRightbit = Microsoft.VisualBasic.Right(strOriginal)

    Try this and let us know if it works!

  3. The Following User Says Thank You to jeremybarker For This Useful Post:

    BygAuldByrd (2012-07-04)

  4. #3
    2 Star Lounger
    Join Date
    Dec 2009
    Location
    Bogangar NSW Australia
    Posts
    105
    Thanks
    25
    Thanked 2 Times in 2 Posts
    Hi Jeremy,

    That's sorted out the Right() function.

    I also tried that fix on IsObject but it didn't resolve that issue

    Now all I need to resolve is the IsObject() function issue and my code should work just how I desire.

    Many Thanks for your assistance.

    Cheers

    Trevor

  5. #4
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,259
    Thanks
    130
    Thanked 1,152 Times in 1,061 Posts
    According to this, IsObject was replaced by IsReference.

  6. The Following User Says Thank You to ruirib For This Useful Post:

    BygAuldByrd (2012-07-04)

  7. #5
    2 Star Lounger
    Join Date
    Dec 2009
    Location
    Bogangar NSW Australia
    Posts
    105
    Thanks
    25
    Thanked 2 Times in 2 Posts
    Hi Ruirib,

    Replacing IsObject with IsReference as you suggested solved my problem

    Many thanks for the prompt response and solution.

    Cheers

    Trevor

  8. #6
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,259
    Thanks
    130
    Thanked 1,152 Times in 1,061 Posts
    Great, you're welcome .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •