Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Yet more excel trouble
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
00980651
Message ID:
00980841
Vues:
82
Another suggestion
old_error = ON("ERROR")
fl_error = .f.
ON ERROR fl_error = .f.
oExcel = GetObject(,"Excel.Application") && To get an existing instance of the Excel
IF fl_error .OR. TYPE("oExcel") # "O" .OR. ISNULL(oExcel)
   oExcel = CreateObject("Excel.Application")
ENDIF
IF fl_error .OR. TYPE("oExcel") # "O" .OR. ISNULL(oExcel)
   MessageBox("I can't create an Excel Object", 0, "Warning")
   ON ERROR &old_error
   RETURN .f.
ENDIF
oWorkbook = oExcel.workbooks.open(alltrim(basevars.baseljb) + "LaserJobbag.xls")
ON ERROR &old_error
IF fl_error .OR. TYPE("oWorkbook") # "O" .OR. ISNULL(oWorkbook)
   MessageBox("I can't Open Excel WorkBook", 0, "Warning")
   RETURN .f.
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform