>Hey all,
>
>I have the following code:
>
>WITH THIS.Columns[i]
> * Save properties...
> lcPrevCaption = .Header1.Caption
> lnPrevAlignment = .Header1.Alignment
> * Remove default header object and add our own hdr object .RemoveObject('Header1')
> .AddObject('Header1', 'hdr', i)
> etc.
> etc.
>ENDWITH
>
>On the .AddObject line I get an error "Object name is invalid", and the debugger shows that that Header1 still exists for the grid column in question. Why hasn't RemoveObject removed it? And why do I get "Object name is invalid" instead of "Member name already exists".
>
>The above code runs fine once the form is up and fully visible, and it only breaks in the above-described fashion if I execute the code before showing the form the grid is on. Would the visibility have something to do with it? Please advise...
>
>Thanks!
>
>Joe Kaufman
>ENCOMPASS Health Mgmt. Systems
This is a known problem with removing grid members. The object isn't really there, but there is some observable internal latency when reomving it. For a moment VFP thinks it's still there. Just name it something else.
Erik Moore
Clientelligence