2 Replies Latest reply: Dec 14, 2012 7:58 AM by Pedram Mobedi RSS

    Open File Dialog that Works with Win7

      Hello there! The old open file dialog that I used with QLikView no longer works on Win7. The sub used "MSComDlg.CommonDialog" and this was the code for the Sub.

       

      ' Sub to show open/save dialog
      SUB OpenSave (varOpenSaveInputBox, varOpenSaveType, varOpenSaveFilter)  
        
      ' Create object
        
      SET objComDlg32 = CreateObject("MSComDlg.CommonDialog")
        
      ' Set memory buffer
         objComDlg32
      .MaxFileSize = 260
        
      ' Set filter
         objComDlg32
      .Filter = varOpenSaveFilter
        
      ' Show dialog
        
      IF varOpenSaveType = 0 Then
            objComDlg32
      .ShowOpen
        
      ELSE
            objComDlg32
      .ShowSave
        
      End IF   
        
      ' Get filename from dialog
         strOpenSave
      = objComDlg32.FileName
        
      ' Check IF dialog is cancelled
        
      IF strOpenSave <> vbNullString Then
           
      ' Set to variable
            objOpenSave
      .SetContent strOpenSave, TRUE
        
      End If
      END SUB

       

      Can anyone suggest an open file dialog that works? Thanks.