Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel instantiation and Illegal Operation Error
Message
De
03/02/1999 20:46:47
Carol Adler
U.S. Army Kwajalein
Apo, Iles Marshall
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Excel instantiation and Illegal Operation Error
Divers
Thread ID:
00183729
Message ID:
00183729
Vues:
46
I wanted to check to see if an instance of Excel was already running ,and if so, don't open a new one, but open the document. If not, then open a new instance of Excel.

I have it figured out in Word, but not in Excel.

------------------

Next problem: VFP(5.0a) takes the data from the view (finance_report) and dumps it into the file text.xls, opens Excel, selects all, autofits the columns, and places the selection in cell A1.

The user will then "Send" the document. If I Exit out of Excel, everything is great and I'm returned to VFP. However, if I close the document, I am returned to VFP with an 'illegal operation' error from Excel.

How do I handle this?
-----------------------------
Here's my code:

USE finance_report in 0
copy fields except travnbr_b,travnbr_c to c:\temp\text.xls type xls
IF TYPE("oExcel") != "O"
PUBLIC oExcel
oExcel=createobject("Excel.Application")
ENDIF
oExcel.Workbooks.Open("C:\Temp\text.xls")
oExcel.visible = .t.
oExcel.cells.select
oExcel.selection.columns.autofit
oExcel.range("A1").select
Release oExcel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform