MODI & WIA Scanning Errors

G

Guest

Hi everyone,

I've actually already posted this question on another NG, but received no
answer for 3 days. Additionally I've got some more diagnostics.

Configuration:
OS: Windows XP Professional SP2
Device: Brother MFC 8460n
Other: Microsoft Office 2003 SP2

First the MODI problem:

If I try scanning via MODI (the app, I haven't tried the COM object) then I
can use any preset except for "Black and White". I f I use the "Black and
White" preset I get the following error:

"Scan New Document: The scan failed because of a hardware scanner error.
Feeder may be jammed. Please correct the error and scan again."

This error occurres regardless of whether the ADF option is on or off.
Interesting enough, I made a new preset which is also B&W. It gives the same
error.

Now, This whole MODI business is not so important to me. I only discovered
it as I
tried debugging some VBA code that I wrote. Which comes next...

I've pasted below the relevent snippet of some VBA code. The goal of the
code is to scan a file via WIA (Microsoft Windows Image Acquisition Library
v2.0 - wiaaut.dll) and save it as a .tif file. The problem is that the code
throws an exception on the following line:

Set oImagefile = oCommonDialog.ShowTransfer(oItem, wiaFormatTIFF)

Just in case, I tried changing to:
Set oImagefile = oCommonDialog.ShowTransfer(oItem,
"{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}")

Same thing. The error is #-2147024809 (80070057). "The parameter is
incorrect.". If I change the FormatID from wiaFormatTIFF to wiaFormatJPEG
then
the code runs just dandy.

Now, the scanner can definitely save as TIFF images. I tried using MODI for
the scanning and it came in as a tif file, no problem. Of course, as long as
I did not use "B&W"

So, why can't I scan as .tif via wia (no pun intended!).

All this is on a clients computer. On my own computer, also WIN XP PRO SP2
w/MSO 2003 SP2, I'm able to use both formats in the code (TIFF and JPEG).
My computer is attached to a HP PSC 1215 All-In-One.

The only difference I can think of, eside the obvious models, is that the
Brother has an ADF and the HP doesn't. But again, the errors occur with ADF
turned on or off, regardless.

Here is the code:

Dim oDevice As Device
Dim oItem As Item
Dim oCommonDialog As New CommonDialog
Dim oImagefile As ImageFile

On Error Resume Next
Set oDevice = oCommonDialog.ShowSelectDevice(ScannerDeviceType, False)
On Error GoTo 0

If oDevice Is Nothing Then
M = MsgBox("Sorry. No scanner available. Make sure your scanner is
connected and turned on and try again.", , APPTITLE)
Exit Function
Else
M = MsgBox("Please put the document into the scanner." & Chr(13) &
Chr(13) & "Click Okay when ready.", , APPTITLE)
End If

Set oItem = oDevice.Items(1)
Set oImagefile = oCommonDialog.ShowTransfer(oItem, wiaFormatTIFF) '-ERROR
If oImagefile Is Nothing Then Exit Function
oImagefile.SaveFile stFilePath

Google Groups does not even have one single post about this error!

I'd really appreciate feedback of any kind,
YisMan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top