Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel OLE Automation Server
Message
De
13/12/1999 12:47:27
 
 
À
13/12/1999 12:44:36
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00302601
Message ID:
00302817
Vues:
28
oops - hit send to quick - that should have read:

I agree in general - I do not like imbedded Returns and only use them on very small library procedures a la ...

If this
return this
else
return that
endif


>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform