PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
App.Path-VBForums
Results 1 to 11 of 11

Thread: App.Path

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    15

    App.Path

    Has anyone seen an instance where app.path does not worK? I am just trying to view it by using:

    vPath = App.Path
    MsgBox vPath

    Are there any referrences that should be included?

  2. #2
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383
    that should work...

    did you do

    VB Code:
    1. Dim vPath as string
    2. vPath = App.Path
    3. MsgBox vPath

    or did you try just

    VB Code:
    1. msgbox App.Path


    did you get an error? or just a blank msgbox when you tried it?
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    15
    This is my code exactly as it is in the program.

    Private Sub Command0_Click()

    Dim vPath As String
    vPath = App.Path
    MsgBox vPath

    End Sub

    When the button is clicked I get:

    Run time error '424'
    Object required


    Debug highlights "vPath = App.Path"

  4. #4
    Addicted Member run_GMoney's Avatar
    Join Date
    May 2002
    Location
    Detroit
    Posts
    186
    I've entered that exactly in my program and it ran fine.

  5. #5
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335
    You are not using VB are you? (There is no Command0 button in VB)

    I'm guessing you are probably using Access, or some form of VBA, like Excel or something.

    I don't know if App.Path is supported on these platforms.

    However, I can categoretically tell you that if you were, indeed, using Visual Basic your code would work. I just ran it. It worked fine.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  6. #6
    Addicted Member run_GMoney's Avatar
    Join Date
    May 2002
    Location
    Detroit
    Posts
    186
    I thought that perhpas he could have renamed the button Command0 for some unspecified reason...

  7. #7
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383
    Originally posted by Hack
    You are not using VB are you? (There is no Command0 button in VB)
    yeah... use

    Code:
    currentproject.Path
    if you are using access 2k or XP... not sure if it is in Access 97
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  8. #8

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    15
    You are correct, I'm using Access. currentproject.Path worked fine. Thanks for your help.

  9. #9
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    You do have to be careful with App.Path though, i've noticed that if you use it on the root of a drive you get "C:\" but if you run in a sub directory you get "C:\myDir". Note the backslash.

    Just something i thought i'd share.
    We don't know what's wrong. . . So the best bet might be to remove something surgically.

  10. #10
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383
    Originally posted by Blinky Bill
    You do have to be careful with App.Path though, i've noticed that if you use it on the root of a drive you get "C:\" but if you run in a sub directory you get "C:\myDir". Note the backslash.

    Just something i thought i'd share.
    ummm yeah isn't that the whole points of app.path?
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  11. #11
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    yes it is, but i've had a few probs in the past with installers where i've tested the code on my system, and it hasn't worked on the cd and it was because i didn't allow for the fact that it was running in a sub dir on my system and a root dir on the cd, so i thought i'd mention that it's not an entirely consistent function. Consistent would be always appending the backslash.
    We don't know what's wrong. . . So the best bet might be to remove something surgically.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width