>>>I searched the project and this is what I came up with as the only place I use "HDR1". I can't pinpoint the code that causes the error. The error only occurs when the program is run from the exe, where I can't debug. If I run it from the command window within VFP it is fine. That's what's making me crazy! And this was working beautifully in VFP6.
>>
>>You can debug the .exe if you
do your.exe
from the command window. Could it be your grid is looking for its recordsource and getting instantiated as soon as it sees it? You may put a breakpoint in your code on one of those lines where hdr1 is mentioned and try to run the exe with that. One more thing - if this is happening as I imagine it is, your header class .prg file is still not set procedure to - you may use newobject() instead of addobject() and see if that fixes it.
>
>I just tried using newobject() but I have the same problem.
Weird, and sounds like a real bug. Couple of things I'd check - see if file("myheaderclass.prg") returns .t. from within the grid setup code, and what is the set("procedure") returning at that point. Somehow this seems that the grid setup is firing far earlier than we may think.