Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Illegal operation
Message
De
30/06/1999 04:20:01
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
29/06/1999 12:48:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00235217
Message ID:
00235728
Vues:
27
>If you set the visibility of excel to false and then set loExcel to null
>
>Ex:
>
>loExcel = CreateObject('Excel.Application')
>loBook = loExcel.ActiveWorkBook
>lcFileName = "C:\Pam\statusreports\May-Data Man.xls"
>loExcel.Workbooks.Open(lcFileName)
>loExcel.Visible = .T.

I'm opening Excel like this:
x=getfile("xls")
oExcel=createobject("Excel.Application")
oExcel.Workbooks.open(x)

I get no error (except when there's no file), works just fine with Excel 97. I keep doing some extensive knitting around the workbook without having an object referrence to the workbook itself - the next line is oExcel.workbooks(1).activate, and I work with oExcel object only. Works just fine.

>loExcel.Visible = .F.
>* Closes the workbook
>loExcel.WorkBooks.Close
>*Releases the application
>loExcel = .Null.

I'm closing Excel like this:
oexcel.activeworkbook.close(1) && this should be equivalent to save+quit in Excel
release oexcel

It closes both the workbook and excel - in my case, that's exactly what I wanted, because I'm doing an automatic update where Excel remains completely invisible all the time.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform