?
Solved

Object Create string of DLL classes

Posted on 2004-08-12
5
Medium Priority
?
351 Views
Last Modified: 2010-05-02
i like to create an object from a dll that i programmed in vb.

it should be done as

set object = Createobject("CLASSNAMESTRING_HERE")

with excel it can be done as

set object = Createobject("Excel.Application")

which string do i have to use in the dll and where do i enter this string ?
0
Comment
Question by:TSYSTEMS_EPDMM
  • 2
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
Belthazor earned 1000 total points
ID: 11784303
Hi, just did that yesterday:

1. In VB -> new project -> ActiveX DLL
2. Name the Project (lets say "MyLibrary")
3. Name the ClassModule (lets say "Functions") and set Instancing to MultiUse
4. Write your functions, Public Functions will be accessible (lets say Public MyFunction(Param))
5. Compile and Save your DLL (lets say to "C:\MyLibrary.dll")
6. Goto Start->Run-> "regsvr32 C:\MyLibrary.dll" (the DLL is registred in Windows no, to unregister run "regsvr32 -u C:\MyLibrary.dll")
7. Use it like:
Dim Object
Set Object = CreateObject("MyLibrary.Functions")
Object.MyFunction(Param)

Belthazor
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 11784337
Your progid is composed by


ProgramName.ClassName
0
 

Author Comment

by:TSYSTEMS_EPDMM
ID: 11784444
what is the program name in a dll ?

the name of the project file ?
0
 
LVL 3

Expert Comment

by:Belthazor
ID: 11784480
yes,the project name, but make sure you have registred your dll as descript in my previous post !
0
 

Author Comment

by:TSYSTEMS_EPDMM
ID: 11784589
ah it works. fine.

my problem was i didnt set the instancing to multiuse.

thx for ur answer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question