Working with VBA classes via WSH possible?

  • Thread starter Thread starter Stefan Bialucha
  • Start date Start date
S

Stefan Bialucha

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.
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top