اخي الكريم
تفضل هذا الكود البسيط لجلب الصورة من الماسح الضوئي
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)
filepath = CurrentProject.Path & "\" & "SCAN" & "-" & Format(Now, "dd-mm-yyyy" & "-" & "hh:mm") & ".jpg"
Set imagefile = sdialog.ShowAcquireImage()
imagefile.SaveFile filepath
[اسم مربع عنصر التحكم لوضع لتخزين المسار] = filepath
errorhandleexit:
Exit Sub
errorhandle:
MsgBox Err.Description
Resume errorhandleexit