I agree in general - I do not like imbedded Returns and only use them on very small library procedures a la '
If this
>This line of code brings up a topic that has always bugged me....
>
>oLineGraph = CreateObject('Excel.Sheet')
>If !File('EachLine.XLS')
> MessageBox('File EACHLINE.XLS is not found!',16)
> Return
>EndIf
>ThisForm.oLineGraph.WorkBooks.Open('EachLine.XLS')
>
>IMHO, placing returns in the middle of code blocks can make for a lot of problems. Rather, I would suggest:
>
>oLineGraph = CreateObject('Excel.Sheet')
>If File('EachLine.XLS')
> ThisForm.oLineGraph.WorkBooks.Open('EachLine.XLS')
>Else
> MessageBox('File EACHLINE.XLS is not found!',16)
>Endif
>
>Return
>
>I wonder what other's think?????
>
>
>
>
>
>
>>Hi there,
>>
>>First add a OLE Bound control in your form and following are the sample code to open an excel file. (assuming filename is "EACHLINE.XLS" and the OLE bound control name is "oLineGraph")
>>
>>
>>oLineGraph = CreateObject('Excel.Sheet')
>>If !File('EachLine.XLS')
>> MessageBox('File EACHLINE.XLS is not found!',16)
>> Return
>>EndIf
>>ThisForm.oLineGraph.WorkBooks.Open('EachLine.XLS')
Ken B. Matson
GCom2 Solutions