简体   繁体   中英

ActiveX component can't create object. Hasp in Excel VBA

I wanted to create object of HASP app in VBA in Excel, but I have such error:
Run-time error '429': ActiveX component can't create object.

I installed hasp_com_windows.dll in SYSWOW64 folder and hasp_com_windows_x64.dll in System32. I also add reference to Aladdin Knowledge Systems Ltd. HASP SRM API Library .

My OS: Windows 8.1. 64 bit

My VBA code:

Sub TestHasp()

Dim haspApp As AKSHASP.HaspApplication
Set haspApp = CreateObject("AKSHASP.HaspApplication")  'here is an error

End Sub

Here are these dll files: hasp dll

=======
Edit:
When I use:

Dim haspApp as new AKSHASP.HaspApplicaton

I get: Compile error: User-defined type not defined.

The error is consistent with the DLL not being installed properly. Try using Tools / References / Browse... then select either or both of the DLLs to install them. You may need to run Excel an an Administrator before you do this, so that Excel can write to the Registry.

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