Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
    
open VBE and hit F2 to see Object Browser. Find the library and go through the classes. It makes a little or no sense to Dim an object using half early half late binding. Try to use an early binding only ie. Dim haspApp as new AKSHASP.HaspApplicaton –  vba4all Aug 4 at 10:40
    
For what should I go through the classes? If I I use this early binding I get: Compile error: User-defined type not defined. –  Monic Aug 4 at 10:48
    
To get familiar with the library you're using :) –  vba4all Aug 4 at 10:53
    
Okey, so I didn't know that I can do sth like this. Now I know. :) And did you meet with such compile error? –  Monic Aug 4 at 11:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.