I have a subroutine:
Sub ConvertExtractToXLSX(eExtract As Extract)
Where Extract is the interface I've implemented into another class:
ConveyExtract
I plan to make several more classes that implement Extract. I would like to be able to make ConvertExtractToXLSX accept any class I create that implements the Extract interface.
Is it possible to do this with VBA? Or would I be forced to use Optional parameters and add code to throw an error at runtime when no parameter is passed? Sure I could probably come up with a generic solution that fails at runtime if the incorrect object is used but it would be really nice to implement a solution that will error at compile time if it the wrong object is used.
Sub ConvertExtractToXLSX(eExtract As Extract)
Where Extract is the interface I've implemented into another class:
ConveyExtract
I plan to make several more classes that implement Extract. I would like to be able to make ConvertExtractToXLSX accept any class I create that implements the Extract interface.
Is it possible to do this with VBA? Or would I be forced to use Optional parameters and add code to throw an error at runtime when no parameter is passed? Sure I could probably come up with a generic solution that fails at runtime if the incorrect object is used but it would be really nice to implement a solution that will error at compile time if it the wrong object is used.