Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel DisplayAlerts
Message
De
06/07/2011 13:42:40
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
 
 
À
05/07/2011 15:30:04
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01517330
Message ID:
01517460
Vues:
46
We have a custom class, cusExcel, that wraps an Excel object. When we call various methods we set (reset) DisplayAlerts because it does set itself to .T. at times. At least with Office 2007.
CreateExcel()
LOCAL RetVal
IF TYPE('This.oExcel') # 'O' AND NOT ISNULL(This.oExcel)
This.oExcel = CREATEOBJECT('Excel.Application')
ENDIF
IF TYPE("This.oExcel") = 'O' AND NOT ISNULL(This.oExcel)
RetVal = .T.
This.oExcel.DisplayAlerts = .F.
ENDIF
RETURN m.RetVal

Hide()
This.oExcel.Visible = .F.
This.oExcel.DisplayAlerts = .F.

AsSave()
...
IF This.oExcel.Visible
This.oExcel.DisplayAlerts = This.DisplayAlerts
ELSE
This.oExcel.DisplayAlerts = .F.
ENDIF
....

Close()
IF .oExcel.Visible
.oExcel.DisplayAlerts = .DisplayAlerts
ELSE
.DisplayAlerts = .F. && DisplayAlerts can get reset.
ENDIF
....

Save()
....
IF .Visible
.DisplayAlerts = This.DisplayAlerts
ELSE
.DisplayAlerts = .F. && DisplayAlerts can get reset.
ENDIF
...

This seems to control the DisplayAlerts fine.
Charlie
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform