ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Working with VBA classes via WSH possible? (https://www.excelbanter.com/excel-programming/310723-working-vba-classes-via-wsh-possible.html)

Stefan Bialucha

Working with VBA classes via WSH possible?
 
I have created a few VBA objects ("classes") in a workbook. Now i would like
to use them in a WSH script without opening the workbook as well as calling
a workbook macro. Is it possible?

Could not find any information on that on the web so far. I've tried to
create the object via GetObject on exported .cls-file, but this does not
work. Do i maybe have to recompile it in VB6 instead or the like?

Thanks in advance,
Stefan Bialucha.



Stefan Bialucha

Working with VBA classes via WSH possible?
 
Ok, i have to refine the question to two cases:
1) The VBA object does not interact with Excel at all, let's say it just
acts as a file interface.
2) The VBA object does interact with Excel, let's say it calls workbook
macros or uses sheets for data handling.



Tom Ogilvy

Working with VBA classes via WSH possible?
 
Nothing to do with code would be accessible from a closed workbook.

Classes can only be used in the workbook in which they are defined to the
best of my knowledge, so if you wanted to make some type of library, then
you would probably do as you suggest, make them into a DLL or something in
VB6. That assumes that they just use generic VB6 objects, properties and
methods and nothing from Excel. An exported file is a simple text file.

--
Regards,
Tom Ogilvy

"Stefan Bialucha" wrote in message
...
I have created a few VBA objects ("classes") in a workbook. Now i would

like
to use them in a WSH script without opening the workbook as well as

calling
a workbook macro. Is it possible?

Could not find any information on that on the web so far. I've tried to
create the object via GetObject on exported .cls-file, but this does not
work. Do i maybe have to recompile it in VB6 instead or the like?

Thanks in advance,
Stefan Bialucha.






All times are GMT +1. The time now is 04:50 PM.

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