السلام عليكم ورحمة الله
اساتذتنا واخواننا في هذا المنتدى تحية لكم
ارجو مساعدتي في خطاء برمجي عند الضغط على زر السكنر تظهر لي هذه الجملة (Type mismatch)
Private Sub أمر166_Click()
On Error Resume Next
Dim y
y = [dd] & "\" & [رقم الطلب]
Dim fs As Object
Dim q As Object
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FolderExists(y) = True Then
Else
Set q = fs.Createfolder(y)
End If
Dim hg, OldFile, DBwithEXT
Dim fdialog As Office.FileDialog
Dim filepath As String
Dim sdialog As New WIA.CommonDialog
Dim imagefile As WIA.imagefile
On Error GoTo errorhandle
Set fdialog = Application.FileDialog(msoFileDialogSaveAs)
OldFile = Me.x
DBwithEXT = Dir(OldFile)
hg = y & "\" & [a] & " " & [b] & " " & Format([c], "yyyy-mm-dd") & " " & [d] & "." & Right(DBwithEXT, 3)
With fdialog
.Title = "Save as"
.AllowMultiSelect = False
.InitialFileName = [hg]
If .Show Then
filepath = .SelectedItems(1)
'
Else
Exit Sub
End If
Set imagefile = sdialog.ShowAcquireImage()
imagefile.SaveFile filepath
[ImagePath] = filepath
End With
errorhandleexit:
Exit Sub
errorhandle:
MsgBox Err.Description
Resume errorhandleexit
End Sub