Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE Automation
Message
De
07/08/1997 10:59:07
 
 
À
07/08/1997 00:33:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00043474
Message ID:
00043524
Vues:
38
>Is there any way I can trap errors when doing OLE automation to EXCEL (any MS products) instead of me getting unfriendly error message? How do I check whether EXCEL is installed in my customer PC so that I can disbale the command button to launch EXCEL. > >I would like to highlight rows in the EXCEL with different color based on exceeded value on the row cells. How can I do this or command I can use. I have tried recording the macro and typing the commands but this does not work. The macro recorded is as follows : (how do I translate this in VFP) > > .Row('7:7').Select > With Interior.Selection > .ColorIndex=6 > .Pattern=lssolid > ENDWITH > >Thanks. Dear Farouk, Try opening an excel object under VFP (which you may have already done). Suppose your handle to the Excel object is 'objExcel', then call each cell individually from within a VFP program something like this; WITH objExcel.Cells(m.lnRowNumber, m.lnColumnCount).Font
.Name = "Britannic Bold"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = .F.
.Superscript = .F.
.Subscript = .F.
.OutlineFont = .F.
.Shadow = .F.
ENDWITH
This is a working version for changing fonts and cell attributes. You could play around with ; objExcel.APPLICATION.RANGE((lcRange)).Select if you wish to select any range in the excel worksheet, or better still, WITH objExcel.Cells(7,7)
.ColorIndex = 6 .Pattern = "lsSolid" ENDWITH Hope it works for you. Sanjay
Sanjay Kapoor

Relatively speaking is a conversation with Einstein
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform