Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Second Post - Please Help with Excel error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Second Post - Please Help with Excel error
Divers
Thread ID:
00410269
Message ID:
00410269
Vues:
53
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.

Note: Sometimes when I get into work, I can just click "Ignore" and it finishes correctly. Sometimes I receive additional errors and it does not finish correctly.

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

Click here to load this message in the networking platform