简体   繁体   中英

Excel VBA ActiveX '429' Run-time error

I've been using a third party library called 'Imagemagick' and though it loads fine, and everything seems to show up I've had a constant issue with getting it to actually work.

I've tried registering the DLL with Windows, but that wasn't an issue since it was registered. Tried reinstalling many different versions of the library, tried a few different ways of writing it. I also tried reinstalling Visual C++. I've also tested the 'sample' programs to see if it would work with them, and it worked fine.. So it seems like it is something wrong with how Office loads it/processes it. I tried repairing Office and even tried using a fresh install, but it didn't seem to change anything.

Code:

Dim objIM
Set objIM = CreateObject("ImageMagickObject.MagickImage.1")
^Error occurs here on line 2
Dim msg

msg = objIM.Convert("C:\Users\NAME\Desktop\Other\Photos\83bab55547a2f3ecf4d29ac36639dc74.png", "C:\Users\NAME\Desktop\Other\Photos\83bab55547a2f3ecf4d29ac36639dc74.jpg")
^Error occurs here too

It was an issue due to my version of Office. I was using a 64 bit version of Imagemagick when I had a 32 bit version of Office. If anyone has a similar issue, and the coding seems alright.. I suggest you check your version of office under 'HELP' in the 'File' tab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM