Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sometimes it works, sometimes it don't!
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Sometimes it works, sometimes it don't!
Miscellaneous
Thread ID:
00409875
Message ID:
00409875
Views:
49
I am using the following code to copy a spreadsheet to a dbf on a nightly basis. Sometimes it works flawlessly. Sometimes I get the following OLE error message. The error message is first. The code is second. Any ideas??

Error Message:
OLE IDispatch code 1004 from Microsoft Excel: Unable to get the Select property of the Range class.

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
oSheet.RANGE("A4:T450").select

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

oExcel.quit()
RELEASE oExcel

TIA
Michael Helms

May the Schwartz be with you.<(©¿©)> -- Mel Brooks
"Someday, and that day may never come, you will be called upon to perform a service" -- Vito Corleone
"Live like there is no tomorrow, Dance like no one is watching, Love like you've never been hurt." -- Anonymous
"I'm thinking about joining the campaign for shorter tag lines." -- Me
Reply
Map
View

Click here to load this message in the networking platform