--- In [email protected], "Sheri" <sheri...@...> wrote:
> Have so far only repeated the Excel and InDesign tests I was using before. > > The InDesign one still gets a com exception on the previously discussed > Search method, whenever the ANSI "for" argument (provided from vector) is a > series of digits than needs to be fed as a Variant (or as a String). > function: Objects* Search(IN VARIANT for (optional), IN VARIANT wholeWord > (optional), IN VARIANT > caseSensitive (optional), IN VARIANT replacingWith (optional)) > > using COMplugin0.72_100107.zip I get (for the values in the first row of the > vector): > > ERROR: com.method: Invoke failed (sys code 80020009: "Exception occurred.") > > local r=myselect.Search(chgVec[i,1], wholeword, casesensitive, chgVec[i,2]) > The values in the failing vector row are > chgVec[0,1]:123 > chgVec[0,2]:abc Sorry, can;t really debug something so obscure without running sample myself. Let me know if you find any other VARIANT arguments that seem to not be working. Let me know how set_arg_types works for you. > Did you see or experiment at all with the following previously posted info? > From what I gather, the argument data goes into a Variant with VT_VARIANT on > it Again, no. argument goes into a VARIANT of the correct type (to repeat: you _cannot_ pass a VARIANT of type VT_VARIANT. > and its pointer goes into another as VT_BYREF|VT_VARIANT. That I could do. The VARIANT passed would be VT_BYREF|VT_VARIANT and I'd have to set pvarVal to point to a VARIANT of some real type. > > Another possibly useful site: <http://www.devguy.com/fp/Tips/COM/> > > "Even if a method accepts a VARIANT as opposed to a VARIANT *, > > pointers can be passed indirectly via VT_BYREF|VT_VARIANT. > > VBScript passes [in] VARIANTs in this fashion." Possible, but messy to do. I'll try next week. > ~Happy New Year~ Same to you.
