?
Solved

Imagemagick ActiveX error 429

Posted on 2012-08-17
7
Medium Priority
?
3,087 Views
Last Modified: 2012-08-27
Here is my VBA code:
Sub Test2()
    Dim MGImg As New MagickImage
    Dim Source As String
    Dim Dest As String
    Source = "C:\3.Store\test1.jpg"
    Dest = "C:\3.Store\vbout.jpg"
    MGImg.Convert Source, "-crop", "500x500+10+10", Dest    'Error occurs here
End Sub

I get a "Run-time error'429': ActiveX component can't create object"

The DLL for Imagemagick is registered as checking the Registry, I find "ImageMagickObject.dll" in two places, both with the same data value of "C:\Program Files\ImageMagick-6.7.9-Q8\ImageMagickObject.dll"

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{9AA0FC6A-63C7-3632-BD6B-7CAF646E51A0}\1.0\0\win32

HKEY_CLASSES_ROOT\TypeLib\{9AA0FC6A-63C7-3632-BD6B-7CAF646E51A0}\1.0\0\win32

I can also confirm the dll file is in the proper location
C:\Program Files\ImageMagick-6.7.9-Q8\ImageMagickObject.dll

When I try to un-register or re-register via
c:\ regsvr32 ImageMagickObject.dll
I get the error:  "LoadLibrary("ImageMagickObject.dll") failed - The specified module could not be found."

If I perform the regsvr32 command inside the ImageMagic folder, or reference the path directly, I get the same error.

ImageMagic does work fine from the cmd line or from a batch file, I just can't call it directly from VBA.

What else could I check to fix the dll link for my project?  Could something else be triggering the error?

I also read a comment about how one aspect of the COM object being corrupt could corrupt the entire dll.  I've tried the 8bit static and the 16 bit dll from ImageMagick, same issue.
0
Comment
Question by:shawnkimble
  • 4
  • 3
7 Comments
 

Author Comment

by:shawnkimble
ID: 38307775
The reason I'm writing the VBA call was because I was unable to find a way to get the output of the ImageMagick's compare statement to a variable.  

Finally found this link that explains how to pipe the output in a batch file
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=12618&start=0

Format to pipe output via batch to txt file:
compare -metric ae out3.jpg out4.jpg null: 2>output.txt

The non-obvious need for the "2" for windows users, is due to Unix

Still would like to solve above problem, but I now have a work around.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 38318726
Hi, I've used this line to create the object in VBScript:
Set objIM = CreateObject("ImageMagickObject.MagickImage.1")

In Excel, I was able to open the VBA Editor, click Tools --> References, add ImageMagickObject 1.0 Type Library, then run the same line as you to create the object.

Regards,

Rob.
0
 

Author Comment

by:shawnkimble
ID: 38323051
After some digging, and the use of "Dependency Walker" & "regDLLView" I can confirm that ImageMagic is not currently registered.  The registration fails because "Dependency Walker" finds that:

"Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module."

All missing modules are of the format "IM_MOD_RL_?????.DLL.  There are about 120 of them.  Hopefully I can find the DLL that contains these.  Anyone?

IM_MOD_RL_AAI_.DLL
IM_MOD_RL_ART_.DLL
IM_MOD_RL_AVS_.DLL
IM_MOD_RL_BMP_.DLL
IM_MOD_RL_BRAILLE_.DLL
IM_MOD_RL_CALS_.DLL
IM_MOD_RL_CAPTION_.DLL
IM_MOD_RL_CIN_.DLL
IM_MOD_RL_CIP_.DLL
IM_MOD_RL_CLIP_.DLL
IM_MOD_RL_CLIPBOARD_.DLL
IM_MOD_RL_CMYK_.DLL
IM_MOD_RL_CUT_.DLL
IM_MOD_RL_DCM_.DLL
IM_MOD_RL_DDS_.DLL
IM_MOD_RL_DEBUG_.DLL
IM_MOD_RL_DIB_.DLL
IM_MOD_RL_DNG_.DLL
IM_MOD_RL_DPX_.DLL
IM_MOD_RL_EMF_.DLL
IM_MOD_RL_EPT_.DLL
IM_MOD_RL_FAX_.DLL
IM_MOD_RL_FD_.DLL
IM_MOD_RL_FITS_.DLL
IM_MOD_RL_GIF_.DLL
IM_MOD_RL_GRADIENT_.DLL
IM_MOD_RL_GRAY_.DLL
IM_MOD_RL_HALD_.DLL
IM_MOD_RL_HDR_.DLL
IM_MOD_RL_HISTOGRAM_.DLL
IM_MOD_RL_HRZ_.DLL
IM_MOD_RL_HTML_.DLL
IM_MOD_RL_ICON_.DLL
IM_MOD_RL_INFO_.DLL
IM_M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_RL_TGA_.DLL
IM_MOD_RL_THUMBNAIL_.DLL
IM_MOD_RL_TIFF_.DLL
IM_MOD_RL_TILE_.DLL
IM_MOD_RL_TIM_.DLL
IM_MOD_RL_TTF_.DLL
IM_MOD_RL_TXT_.DLL
IM_MOD_RL_UIL_.DLL
IM_MOD_RL_URL_.DLL
IM_MOD_RL_UYVY_.DLL
IM_MOD_RL_VICAR_.DLL
IM_MOD_RL_VID_.DLL
IM_MOD_RL_VIFF_.DLL
IM_MOD_RL_WBMP_.DLL
IM_MOD_RL_WPG_.DLL
IM_MOD_RL_X_.DLL
IM_MOD_RL_XBM_.DLL
IM_MOD_RL_XC_.DLL
IM_MOD_RL_XCF_.DLL
IM_MOD_RL_XPM_.DLL
IM_MOD_RL_XPS_.DLL
IM_MOD_RL_XTRN_.DLL
IM_MOD_RL_XWD_.DLL
IM_MOD_RL_YCBCR_.DLL
IM_MOD_RL_YUV_.DLL
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 65

Expert Comment

by:RobSampson
ID: 38323140
Hi, I can't remember exactly, but I downloaded the program from here:
http://www.imagemagick.org/script/binary-releases.php#windows

and I'm pretty sure I got the top one:
ImageMagick-6.7.9-0-Q16-windows-dll.exe

That installed the ActiveX controls required.  After that, you should be able to add the Reference in the VBA Editor.

Regards,

Rob.
0
 

Accepted Solution

by:
shawnkimble earned 0 total points
ID: 38323181
Tried to find DLL's.  After finding some hunting down the last 30 became a waste of time.  Downloaded ImageMagick-6.3.2-9-Q16-windows-static.exe
from
http://image_magick.veidrodis.com/image_magick/binaries/

Then did a fresh install into a directory that DID NOT CONTAIN A "SPACE" in the folder name.  Registration of the DLL worked!
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 38323185
That's an old version. Grab a newer version from the link I posted.  Glad you got it sorted anyway.
0
 

Author Closing Comment

by:shawnkimble
ID: 38335878
I solved the problem.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Screencast - Getting to Know the Pipeline
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question