Page 1 of 1

Use ImageMagick without install (in VBA)

Posted: 2011-02-23T07:19:30-07:00
by anglerdk
Hi

I have made a VBA script

Code: Select all

Function ResizeImg(ByVal From As String, ByVal to As String, ByVal Q As Integer, ByVal Res As String)

Dim img As Object

Set img = CreateObject("ImageMagickObject.MagickImage.1") 


msg =  img.Convert(From,to) 
msg = img.Mogrify("-resize", Res, "-quality", Q, to)
end function
Works like a dream on my machine, but when trying it on a friends machine - it gave "run-time error 429 , ActiveX cannot create object
(translated from Danish, so the error can be something else in English).
I have made the reference to the ImageMagickObject.dll and tried regsvr32 /c /s "C:\ImageMagickObject\ImageMagickObject.dll" but no luck.

I am using

Windows XP Pro SP3



my question is

is it possible to use ImageMagick without installing it ????? - since it should be used on computers without admin rights


Thanx for your time and help.

Re: Use ImageMagick without install (in VBA)

Posted: 2011-02-23T18:06:57-07:00
by Tachoknight
At the very least the library has to be registered as a COM object so that it can be invoked by VBA. You do this with "regsvr32" at the command prompt like:

Code: Select all

c:\temp>regsvr32 foo.dll
where foo.dll is the IM COM library (don't know what it is offhand, sorry)

Re: Use ImageMagick without install (in VBA)

Posted: 2011-02-24T00:01:03-07:00
by anglerdk
Tachoknight wrote:At the very least the library has to be registered as a COM object so that it can be invoked by VBA. You do this with "regsvr32" at the command prompt like:

Code: Select all

c:\temp>regsvr32 foo.dll
where foo.dll is the IM COM library (don't know what it is offhand, sorry)

tried regsvr32 /c /s "C:\ImageMagickObject\ImageMagickObject.dll and regsvr32 "C:\ImageMagickObject\ImageMagickObject.dll allready

however I get an error: LoadLibrary("ImageMagickObject.dll")failed - The Specified module could not be founded :(

Re: Use ImageMagick without install (in VBA)

Posted: 2011-02-24T01:43:07-07:00
by Tachoknight
Is vcomp100.dll in the same directory as ImageMagickObject.dll? I checked ImageMagickObject.dll and there's a dependency on that other library, so put vcomp100.dll in the same place and try registering ImageMagickObject.dll again.

Re: Use ImageMagick without install (in VBA)

Posted: 2011-02-25T00:21:45-07:00
by anglerdk
tried this also (with the vcomp100.dll in the same folder) - got this:


Load library("imageMagickObject.dll") failed recursion to deep;stack overflow


But I cannot find a package where both the ImageMagickobject.dll and the other DLLs (eg vcomp100.dll)

:(

Re: Use ImageMagick without install (in VBA)

Posted: 2011-02-25T16:47:58-07:00
by Tachoknight
Hmm....did you install the DLL version or the static version? I got it to work with the static version from http://www.imagemagick.org/script/binar ... hp#windows.