Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Second Post - Please Help.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00410269
Message ID:
00410274
Vues:
15
Try to see what the error means.
Use an error subroutine to use the Aerror() function. Then your code must look like

Code:
RELEASE ALL LIKE 'o*'

oExcel= CREATEOBJECT("Excel.Application")
lcFile = "s:\csc\admin\p&lfy01\WL_FY2001.xls"
oBook = oExcel.WorkBooks.Open(lcFile,,,,"umai")

oSheet=oBook.sheets(1)

*!* When error occurs, it happens here! Like I said,
*!* it doesn't happen all the time

ON ERROR ExcelError()

oSheet.RANGE("A4:T450").select

ON ERROR

oExcel.Application.DisplayAlerts = .F.
oSheet.SaveAs("s:\csc\admin\impact\2001\wlt_temp.dbf",8)

oExcel.quit()
RELEASE oExcel


Procedure ExcelError
=AERROR(ErrorArray)
FOR i=1 to 7
?ErrorArray(i)
endfor
ENDPROC
"Anyone who has never made a mistake has never tried anything new." A.E
"The important thing is not to stop questioning. Curiosity has its own reason for existing." A.E
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform