Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
VB6 ActiveX in Office x64 (Read 5418 times)
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
VB6 ActiveX in Office x64
18.08.10 at 15:22:33
VB6 ActiveX in Office x64
Investigating how to use VB6, Visual Basic 6, legacy VB, code in Office x64, a 64 bits environment. I am using Excel 2010 x64 as a test environment.
Trying to use a compiled (32 bits, x86) ActiveX dll:
VB6: Create new ActiveX dll project. Compile the dll.
Excel test code:
Public Sub test()
    Dim o As Object    
    Set o = CreateObject("Project1.Class1")    
End Sub

Error on the set statement: 429 "AcxtiveX component can't create object"
Trying to use a (32 bits, x86) ActiveX dll running in the VB6 programming environment:
Now, let's do the same thing but now run the dll in VB6 instead of compiling it first to a dll.  
Load the project and run it inside VB6.
The ActiveX dll loads fine using CreateObject as long as the dll is running in VB6. Actually this may be because VB6 gives the dll a 32bits process to run in.  
VB6 applications also run as 32 processes. Perhaps it is possible to use a ActiveX exe program that runs as a 32 bits process.
Trying to use a compiled (32bits, x86) ActiveX exe
Now the createobject call seems to work!
Excel x64 can run x86, 32 bits ActiveX exe programs when loaded through VBA using CreateObject.
Back to top
« Last Edit: 18.08.10 at 16:28:39 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1