I'm looking for a way to create an ActiveX dynamically using WithEvents. I want an executable to read params from an ini-file and let the executable create objects, depending on the values of these ini-params.

For instance:

The ini-file contains the following:
[CTask_1]

I want the exe to create an ActiveX object, like:
Dim WithEvents MyObject As CTask_1

This doesn't seem to work using WithEvents; is there a way to accomplish this?