Prev: Migrating to 64 bit access db solution
Next: importing tables in proper format from word 2007 into access2007
From: Vincent on 21 Jan 2010 10:50 I am using late binding to instantiate an object (i.e. I have used CreateObject), but whenever I try to call a method of this object, I receive a type mismatch error. What is odd, to me, is that if I replace the late binding call with an early binding call, the type mismatch error does not occur and the code runs as intended. Does anyone have any ideas what might be triggering the type mismatch error? Thanks. Vincent
From: Salad on 21 Jan 2010 14:04 Vincent wrote: > I am using late binding to instantiate an object (i.e. I have used > CreateObject), but whenever I try to call a method of this object, I > receive a type mismatch error. What is odd, to me, is that if I > replace the late binding call with an early binding call, the type > mismatch error does not occur and the code runs as intended. Does > anyone have any ideas what might be triggering the type mismatch > error? Thanks. > > Vincent An example of your code might help others. We aren't mindreaders that can psychicly predict what you wrote for your code lines.
From: Vincent on 21 Jan 2010 15:14
On Jan 21, 2:04 pm, Salad <sa...(a)oilandvinegar.com> wrote: > Vincent wrote: > > I am using late binding to instantiate an object (i.e. I have used > > CreateObject), but whenever I try to call a method of this object, I > > receive a type mismatch error. What is odd, to me, is that if I > > replace the late binding call with an early binding call, the type > > mismatch error does not occur and the code runs as intended. Does > > anyone have any ideas what might be triggering the type mismatch > > error? Thanks. > > > Vincent > > An example of your code might help others. We aren't mindreaders that > can psychicly predict what you wrote for your code lines. I didn't see why it would matter as I explained the issue. But for those that need to see to believe, here it is the general idea.... 'THIS CODE WORKS Dim oSaladObject As SaladObject Dim retVal as Long retVal = oSaladObject.IEatMeat(strArg1, strArg2, strArg3) 'THIS DOES NOT WORK--Returns type mismatch Dim oSaladObject As Object Dim retVal as Long retVal = oSaladObject.IEatMeat(strArg1, strArg2, strArg3) The only difference is the type declaration. Vincent |