Error 2147024809 w/ Wia.CommonDialog.ShowTransfer

G

Guest

Hi everyone,

I'm new to this Newsgroup so please inform if this is the right group.

I've pasted below the relevent snippet of some VBA code which I've
implemented succesfully on my computer. 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 on a clients machine the code
throws an exception on the following line:

Set oImagefile = oCommonDialog.ShowTransfer(oItem, wiaFormatTIFF)

The error is #2147024809. "The parameter is not correct." or something
similar. If I change the FormatID from wiaFormatTIFF to wiaFormatJPEG then
the code runs just dandy.

Now, the scanner on the clients machine - a Brother MFC-8460n - can
definitely save as TIFF images. I tried using MODI for the scanning and it
came in as a tif file, no problem.

So, why can't I scan as .tif via wia (no pun intended!). On my computer,
which I'm able to use both formats in the code (TIFF and JPEG), I have an HP
PSC 1215 All-In-One.

Both PCs have Windows XP SP2 with Office 2003 SP2. This code runs in an
Access module.

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)

If oImagefile Is Nothing Then Exit Function

oImagefile.SaveFile stFilePath

With utmost appreciation,
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