>Why would the following sometimes work, and sometimes fail, in Excel 97?
>
>I want to insert a logo into all sheets of an Excel workbook I am creating through Automation. I insert the image with the following commands:
>
This.oSheet.Activate
> This.oSheet.Cells(tnRow, tnCol).Select()
> This.oSheet.Pictures.Insert(tcFileName)
>
>This is repeated for many different sheets (the property .oSheet changes its value, according to the selected sheet). On some sheets, quite often on the the second sheet, but in general quite randomly, I get an error message, which, translated into English, more or less says: Impossible to obtain property Select of the Range class. The debugger shows me that VFP is trying to execute the first command I listed.
>
>The debugger tells me that tnRow, tnCol and This.oSheet all have valid values.
>
>Any idea, what I might be missing? Perhaps there is a safer way to insert an image in a specific position?
>
>TIA,
>
>Hilmar.