Solved

Object Create string of DLL classes

Posted on 2004-08-12
5
333 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 250 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

837 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