Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel instantiation and Illegal Operation Error
Message
De
04/02/1999 18:01:54
Carol Adler
U.S. Army Kwajalein
Apo, Iles Marshall
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00183729
Message ID:
00184108
Vues:
20
I tried this new code, but it doesn't check to see if an instance of Excel is already running. Okay, I'm not a purist so I'll forget about checking, especially since the user has a new 333 running NT.

The "&&Do stuff here" needs to be under total control of the user to format, e-mail, etc. If I add the code to close and quit, the user has no opportunity to do anything.

If I leave out the close and quit, and the user selects File Close instead of Exit, then I get the illegal operation.

Did I leave something out?


SET SAFETY OFF
USE finance_report in 0
COPY fields except travnbr_b, travnbr_c to c:\temp\text.xls type xls
SET SAFETY ON
tmpsheet=getObject('','excel.application')
oExcel = tmpsheet.application
oExcel.workbooks.open("c:\temp\text.xls")
oExcel.visible = .t.
oExcel.cells.select
oExcel.selection.columns.autofit
oExcel.range("A1").select

-- Now the user needs total control of their spreadsheet

Release oExcel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform