Monic
Monic

Reputation: 746

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.

Upvotes: 0

Views: 1409

Answers (1)

Nic Paul
Nic Paul

Reputation: 31

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.

Upvotes: 0

Related Questions