Hello, can anyone pin point why this line is erroring?
"runtime error - 438"
Object doesnt support this property or method
'Get file selection from common dialog control
With Me.ComDialogBTN
.DialogTitle = "Select File" ' this is where its highlighting, if i comment this out then it goes to the next line.. does this have anything to do with ActiveX controls or something???
.CancelError = False
.Filter = "All files (*.*)|*.*|"
.FilterIndex = 1
.Flags = MSComDlg.FileOpenConstants.cdlOFNFileMustExist _
Or MSComDlg.FileOpenConstants.cdlOFNPathMustExist _
Or MSComDlg.FileOpenConstants.cdlOFNReadOnly
.InitDir = fnPath("files")
.FileName = ""
.ShowOpen
If .FileName = "" Then Exit Sub
End With
'Extract path and file portions of filename
'Read filename from **RIGHT** to **LEFT**
'Everything to the left of the first "\" encountered is the path
'Everything to the right of the first "\" encountered is the filename
'FileLong = Me.ComDialogBTN.fileName
For X = Len(FileLong) To 1 Step -1
If Mid(FileLong, X, 1) = "\" Then
FilePath = Left(FileLong, X - 1)
FileShort = Right(FileLong, Len(FileLong) - X)
Exit For
End If
Next X
"runtime error - 438"
Object doesnt support this property or method
'Get file selection from common dialog control
With Me.ComDialogBTN
.DialogTitle = "Select File" ' this is where its highlighting, if i comment this out then it goes to the next line.. does this have anything to do with ActiveX controls or something???
.CancelError = False
.Filter = "All files (*.*)|*.*|"
.FilterIndex = 1
.Flags = MSComDlg.FileOpenConstants.cdlOFNFileMustExist _
Or MSComDlg.FileOpenConstants.cdlOFNPathMustExist _
Or MSComDlg.FileOpenConstants.cdlOFNReadOnly
.InitDir = fnPath("files")
.FileName = ""
.ShowOpen
If .FileName = "" Then Exit Sub
End With
'Extract path and file portions of filename
'Read filename from **RIGHT** to **LEFT**
'Everything to the left of the first "\" encountered is the path
'Everything to the right of the first "\" encountered is the filename
'FileLong = Me.ComDialogBTN.fileName
For X = Len(FileLong) To 1 Step -1
If Mid(FileLong, X, 1) = "\" Then
FilePath = Left(FileLong, X - 1)
FileShort = Right(FileLong, Len(FileLong) - X)
Exit For
End If
Next X