Try without the control. Delete the common dialog control and remove it from the components list. Then add a module named something like basCommonDlg.bas and copy this code to it:
vb Code:
  1. Option Explicit
  2.  
  3. Private Enum FlagsEnum
  4.     feOpen
  5.     feSaveAs
  6. End Enum
  7.  
  8. Private Type OPENFILENAME
  9.     lStructSize As Long
  10.     hwndOwner As Long
  11.     hInstance As Long
  12.     lpstrFilter As String
  13.     lpstrCustomFilter As String
  14.     nMaxCustFilter As Long
  15.     nFilterIndex As Long
  16.     lpstrFile As String
  17.     nMaxFile As Long
  18.     lpstrFileTitle As String
  19.     nMaxFileTitle As Long
  20.     lpstrInitialDir As String
  21.     lpstrTitle As String
  22.     Flags As Long
  23.     nFileOffset As Integer
  24.     nFileExtension As Integer
  25.     lpstrDefExt As String
  26.     lCustData As Long
  27.     lpfnHook As Long
  28.     lpTemplateName As String
  29. End Type
  30.  
  31. Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
  32. Private Declare Function GetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long
  33.  
  34. ' Common Dialog - Open
  35. Public Function ShowOpenDialog(pstrInitialPath As String, pstrFilter As String, pstrDefaultExt As String) As String
  36.     Dim typFileName As OPENFILENAME
  37.            
  38.     typFileName = GetStructure(pstrInitialPath, "", pstrFilter, pstrDefaultExt, feOpen)
  39.     If GetOpenFileName(typFileName) Then ShowOpenDialog = Left$(typFileName.lpstrFile, InStr(typFileName.lpstrFile, Chr$(0)) - 1)
  40. End Function
  41.  
  42. ' Common Dialog - SaveAs
  43. Public Function ShowSaveAsDialog(pstrInitialPath As String, pstrFile As String, pstrFilter As String, pstrDefaultExt As String) As String
  44.     Dim typFileName As OPENFILENAME
  45.    
  46.     typFileName = GetStructure(pstrInitialPath, pstrFile, pstrFilter, pstrDefaultExt, feSaveAs)
  47.     If GetSaveFileName(typFileName) Then ShowSaveAsDialog = Left$(typFileName.lpstrFile, InStr(typFileName.lpstrFile, Chr$(0)) - 1)
  48. End Function
  49.  
  50. Private Function GetStructure(pstrPath As String, pstrFile As String, pstrFilter As String, pstrDefaultExt As String, penFlags As FlagsEnum) As OPENFILENAME
  51.     Const OFN_FILEMUSTEXIST = &H1000
  52.     Const OFN_PATHMUSTEXIST = &H800
  53.     Const OFN_HIDEREADONLY = &H4
  54.     Const OFN_LONGNAMES = &H200000
  55.     Const OFN_OVERWRITEPROMPT = &H2
  56.     Const OF_WRITE = &H1
  57.     Const MAX_PATH = 260
  58.     Dim frm As Form
  59.  
  60.     With GetStructure
  61.         .lStructSize = Len(GetStructure)
  62.         ' Get any form's window handle
  63.         For Each frm In Forms
  64.             Exit For
  65.         Next
  66.         .hwndOwner = frm.hWnd
  67.         Set frm = Nothing
  68.         .hInstance = App.hInstance
  69.         .lpstrFilter = Replace(pstrFilter, "|", Chr(0)) & Chr(0)
  70.         .nMaxFile = MAX_PATH + 1
  71.         .nMaxFileTitle = MAX_PATH + 1
  72.         .lpstrFileTitle = Space(MAX_PATH)
  73.         .lpstrInitialDir = pstrPath
  74.         .lpstrDefExt = pstrDefaultExt
  75.         Select Case penFlags
  76.             Case feOpen
  77.                 .lpstrTitle = "Open"
  78.                 .lpstrFile = Space(MAX_PATH)
  79.                 .Flags = OFN_FILEMUSTEXIST + OFN_HIDEREADONLY + OFN_LONGNAMES
  80.             Case feSaveAs
  81.                 .lpstrTitle = "Save As"
  82.                 .lpstrFile = pstrFile & Space$(MAX_PATH - Len(pstrFile))
  83.                 .Flags = OFN_PATHMUSTEXIST + OFN_HIDEREADONLY + OFN_LONGNAMES + OF_WRITE ' + OFN_OVERWRITEPROMPT
  84.         End Select
  85.     End With
  86. End Function
Sample usage: (Note that the code requires any one form to be open, meaning this doesn't work from the debug window.)
Code:
Private Sub Command1_Click()
    MsgBox ShowOpenDialog(App.Path, "All Files|*.*", "*.*")
    MsgBox ShowSaveAsDialog(App.Path, "untitled.txt", "All Files|*.*", "*.*")
End Sub