January 22nd, 2003, 9:36 pm
Greetings!I am interested in overriding the Resize method of Excel's Range object. Ideally, I would create an object called Range that delegated everything to a real Excel.Range object except for this one method. In a perfect world, this would be totally trasparent to the user, so they would call Range("A1").Method, and it would behave exactly as if it were an Excel.Range, except for the Resize case.I'm not sure the above scenario is possible. However, I think it should be possible to set up an extended SpecialRange object that has one procedure to delegate Range methods, ie: SpecialRange.PerformMethod(methodname:="Offset", arguments:=2). In this case, my SpecialRange object would use PerformMethod to pass the user's requested methodname as text to an Excel.Range object, which would then perform the embedded Excel method. My PerformMethod procedure would delegate all methodname strings to the Excel.Range object unless methodname:="Resize". I know it should be possible to send the method request directly to the vtable with the AddressOf operator, but I don't know how to do it in practice. Any suggestions?