Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 39
  1. #16
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Youre not annoying
    Did you place a "Common Dialog Control" on your form? (Project -> Components -> Microsoft Common Dialog Control 6.0)
    If you tell me the error, i can help you.

  2. #17
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Duh guys, move on. Vb6 is outdated.



  3. #18
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    So? Its easy to learn, good for beginners.

  4. #19
    lelelololele's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    160
    Reputation
    10
    Thanks
    5
    My Mood
    Hot
    So, up to now, I have selectet Project --> components --> Microsoft comm control 6.0
    I have placed a button,
    in the button I have this code:
    Code:
    Private Sub Command1_Click()
    With CommonDialog1
        .FileName = ""
        .ShowOpen
        
        If .FileName <> "" Then
            RetVal = Shell("CommonDialog1.FileName", vbWindowState)
        End If
    End With
    End Sub
    End when I run the program an error pops-up saying:
    "Run-time error '424':
    object required"

  5. #20
    justiman's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    47
    Reputation
    10
    Thanks
    4
    My Mood
    Fine
    Quote Originally Posted by Blubb1337 View Post
    Duh guys, move on. Vb6 is outdated.
    yea i said that already lol. vb6 is way outdated. i expect to see a vb 2011 soon

  6. #21
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Quote Originally Posted by Vanoq View Post
    So? Its easy to learn, good for beginners.
    So is VB.Net....well it's your decision...but believe me...every "proper" coder in this section will say so...

    Ask @Hassan , @Jason , @NextGen1....



  7. #22
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Quote Originally Posted by lelelololele View Post
    End when I run the program an error pops-up saying:
    "Run-time error '424':
    object required"
    You have to place the Common Dialog Control on your form and name it CommonDialog1

  8. #23
    lelelololele's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    160
    Reputation
    10
    Thanks
    5
    My Mood
    Hot
    Ohh, well, I have done that..but, that's not what I want :/
    I want to auto-open the file when I click the button..not selecting the file and then open them..

  9. #24
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Okay you want to click a button, check if the file exists and if it exists, you want to start it?

  10. #25
    lelelololele's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    160
    Reputation
    10
    Thanks
    5
    My Mood
    Hot
    yes..but the program will start it automatically, if it exists...NOT the user

  11. #26
    lelelololele's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    160
    Reputation
    10
    Thanks
    5
    My Mood
    Hot
    I am sorry, but I told you I don't want to open something with a Path, that's because when someone downloads my software, the folder will be in the direction folder ( I mean where he wanted the software to be downloaded)...so it is not constant...

  12. #27
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Code:
    Dim file as string
    file = "C:\Yourfile.bat"
    If FileExists(file) = True Then
    Shell(file, vbWindowState)
    End If
    And you need to paste this function:

    Code:
    Function FileExists(File As String) As Boolean
       On Error Resume Next
       FileExists = False
       FileExists = Dir(File) <> ""
    End Function
    You can get the directory of your program by using App.Path:
    Code:
    App.Path & "\"
    Will give you something like "C:\MyProgram\"
    Last edited by edub18; 03-25-2011 at 03:58 PM.

  13. The Following User Says Thank You to edub18 For This Useful Post:

    lelelololele (03-25-2011)

  14. #28
    lelelololele's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    160
    Reputation
    10
    Thanks
    5
    My Mood
    Hot
    Thanks for the source code, how ever, can I have a step by step tutorial?
    pretty please :P

  15. #29
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Tutorial? For what?

  16. #30
    lelelololele's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    160
    Reputation
    10
    Thanks
    5
    My Mood
    Hot
    what to do exactly..I know it is a waste of time for you..but...if you have a website or something, I could mention that for credits..just, something in return :/

Page 2 of 3 FirstFirst 123 LastLast