Answer the question
In order to leave comments, you need to log in
WIA error setting PAGES (VBA) option. Why?
Sub scan()
Dim objDM As WIA.DeviceManager
Dim objDev As WIA.Device
Dim objItem As WIA.Item
Dim objImage As WIA.ImageFile
Dim s As String
Dim i As Integer
Dim p As Property
Set objDM = New WIA.DeviceManager
For i = 1 To objDM.DeviceInfos.Count
If objDM.DeviceInfos(i).Type = 1 Then
s = objDM.DeviceInfos(i).DeviceID
End If
Next
Set objDev = objDM.DeviceInfos(s).Connect
If objDev Is Nothing Then
MsgBox ("Error: Not device found")
Else
objDev.Properties("Document Handling Select").Value = 1
objDev.Properties("Pages").Value = 1
Set objItem = objDev.Items(1)
Set objImage = objItem.Transfer(WIA.FormatID.wiaFormatTIFF)
' objImage.SaveFile "c:\test\" & ActiveCell.Value & ".TIFF"
Set objItem = Nothing
Set objImage = Nothing
Set objDev = Nothing
End If
Set objDev = Nothing
Set objDM = Nothing
End Sub
objDev.Properties("Document Handling Select").Value = 1
objDev.Properties("Pages").Value = 1
objDev.Properties("Pages").Value = 0
Set objImage = objItem.Transfer(WIA.FormatID.wiaFormatTIFF)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question