Hi,
First post here, as have hit a real stumbling block that is crucial to an application I am writing.
I have an Interface Class - coreIReport - it is instantiated as PublicNotCreatable
I have a sheet object in the solution (under Microsoft Excel Objects). It has the code behind with: Implements coreIReport.
This code works only if I step through the code with f8, otherwise, if it is just ran it gives a type mismatch on line "set coreIreport = xSheet". xSheet has all implementation code correctly behind it for the coreIReport interface.
Would be greatful for any help. I suppose the real question is, how to cast a sheet object to an interface in vba?
First post here, as have hit a real stumbling block that is crucial to an application I am writing.
I have an Interface Class - coreIReport - it is instantiated as PublicNotCreatable
I have a sheet object in the solution (under Microsoft Excel Objects). It has the code behind with: Implements coreIReport.
This code works only if I step through the code with f8, otherwise, if it is just ran it gives a type mismatch on line "set coreIreport = xSheet". xSheet has all implementation code correctly behind it for the coreIReport interface.
Code:
dim xSheet as worksheet
dim oCoreIReport as coreIReport
for each xSheet in ThisWorkbook.Sheets
if xSheet.Range("A1").value = coreIReport then
set oCoreIreport = xSheet
end if
next xSheet
Would be greatful for any help. I suppose the real question is, how to cast a sheet object to an interface in vba?