Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Second Post - Please Help.
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00410269
Message ID:
00410274
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform