1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Save File screen?

Discussion in 'Visual Basic ( VB )' started by chico1st, Jul 12, 2007.

  1. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    How do you get one of those screens to pop up which allows you to save a file and navigate around windows folders to do so.

    Also how to you get the open a file screen.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    You have OpenFileDialog and SaveFileDialog which help you doing that.
     
  3. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    I cannot find any information about how to use this with my VisualBasic 6 (it has no help files), can someone please help.
    from what I understand OpenFileDialog returns the entire path of the location that you select.
    but my code doesnt seem to do anything.

    'This does nothing
    FName = OpenFileDialog

    'This gives me an error
    FName = OpenFileDialog()
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    I though you would be using the .NET but VB 6 there is a control for the same.
     
  5. munkyeetr

    munkyeetr New Member

    Joined:
    May 4, 2007
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Victoria BC, Canada
    Use the CommonDialog Control.
     
  6. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    Ok when i click cancel in the open file dialogue i want to execute a command. But by using
    "on error goto cancel" the code in Cancel wont execute one i have executed the loaded a file once. in fact crazy things start to happen. is there any sort of "On cancel exit sub" or something, this is the outline of my code

    Private Sub cmdLoad_Click()

    On Error GoTo Cancel
    ...
    Exit Sub

    Cancel:
    ...
    Exit Sub

    End Sub

    thank you for your time
     
  7. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    nevermind i needed to click the "cancel error" box in the properties of the dialogue box. Apparently without that it wont always give an error.
     

Share This Page