I built EXE with your code and it runs w/o errors. So problem is not EXE but what you are doing differently in EXE
>Has anyone used this in a VFP application?
>
>We are using Word for spell check and the spell check UI stays behind the VFP app. I found this
http://support.microsoft.com/kb/243844>and am trying to make it work in VFP.
>
>No problem when running an APP in VFP in development, but when I try to run it from the compiled EXE it returns a Data Type Mismatch error when I run CoAllowSetForegroundWindow(loWord, 0)
>
>
>Here is what I'm trying
>
>Declare integer CoAllowSetForegroundWindow IN ole32.dll object pUnk, long byVal
>...
>loWord = CREATEOBJECT('word.application')
> CoAllowSetForegroundWindow(loWord, 0)
>
>Any help would be greatly appreciated.
>
>Thanks,
>Larry
--sb--