I am trying to call a method on a COM object which returns a boolean but I keep getting type mismatch errors.<BR><BR>compNameNeeded = CBool(oPWGenEng.ProductNeedsComputerNames())<BR><B R>Any ideas?<BR><BR>Thanks, Erin
Erin, my guess (and it is just a guess, I'm newish at this and yet have been frustrated when nobody answers my questions) is that your variable compNameNeeded is a Variant (a VBScript variable) of subtype String and the result of the CBool is a Variant of subtype Boolean. I've had this problem with trying to get two numbers to match, where one was an integer, and the other a long integer or something. Maybe try:<BR><BR>compNameNeeded = CStr(CBool(etc.))<BR><BR>and see if that works? Boolean values come out as True or False, right? So I imagine a CStr would produce a string of "True" or "False"... is that what compNameNeeded is, either "True" or "False"?<BR><BR>Hope this helps. If not, let me know. email@example.com<BR><BR>Danny.