Results 1 to 3 of 3

Thread: common dialog box

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    1
    Hi. I'm writing a program where i'm using a common dialog box
    - to open a random file. I have an error routine so i can grab the error
    - when the user presses the cancel button. The cancel error option i
    - checked in the dialog's properties, but i still get the error 32755 when
    - the cancel button is pressed.The debugger points me to dialogbox.showOpen
    - or Action = 1 whichever i use. Could someone help me?
    It seems that there is something wrong with the properties.
    Private Sub mnuFileOpen_Click()
    grdGrid.Visible = True
    On Error GoTo eh
    diaClass.Flags = &H1000
    Dim iHandle As Integer
    Dim sClassRec As Class_Info
    Dim iRow As Integer
    iHandle = FreeFile
    diaClass.FilterIndex = 2
    'diaClass.Action = 1
    diaClass.ShowOpen

    diaClass.InitDir = ""

    Open diaClass.FileName For Random As iHandle Len = Len(sClassRec)

    Do Until EOF(iHandle)
    Get #iHandle, , sClassRec

    iRow = iRow + 1
    With sClassRec
    grdGrid.AddItem .sClassNo & Chr(9) & _
    .sRoomNo & Chr(9) & _
    .sUnit & Chr(9) & _
    .sInstructor & Chr(9) & _
    .sDay & Chr(9), _
    iRow
    End With
    grdGrid.Rows = iRow + 1
    Loop
    Close iHandle

    Exit Sub

    eh:

    If Err.Number = 32755 Then
    Exit Sub
    ElseIf Err.Number = 53 Then
    MsgBox Err.Description
    Else
    MsgBox "Error! " & Err.Number & " " & Err.Description, , "Error!"
    End If
    End Sub


  2. #2
    Guest
    Try:
    Code:
    On Error Resume Next
    This will just bypass the error.

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    on error goto QuitNow:

    'set it's value to true
    CommonDialog1.CancelError = True

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

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



Click Here to Expand Forum to Full Width