ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   instance of class from dll, is it possible?? (https://www.excelbanter.com/excel-programming/434640-re-instance-class-dll-possible.html)

rchiuhk

instance of class from dll, is it possible??
 
I have think of a method.
Make the dll which can be accessible in excel. Com-operate.

And then in excel , import it and make use of it by
dim obj as new dllname.dllclass

"rchiuhk" wrote in message
...
Dear all,

I have written a dll with a class with startex() and closeex() procedure.
In excel programming VBA, I have declare the sub of startex and closeex.
They will refer to the dll.
But would startex and closeex share the same object e.g. xlApp and
would closeex close the object (xlApp) which set by startex????

On the other hand, is it possible to declare the class in excel
programming VBA? If yes, then I am sure that they are accessing to the
same instance of the class.
public class class1
{
Excel.Application xlApp;
...
private void startex()
{
xlApp=new Excel.Applicationclass();
..........
}

private void closeex()
{
xlApp.Quit();
releaseobject(xlApp);
...............
}
}







All times are GMT +1. The time now is 06:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com