Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE Problems with Excel 97 - Creating a chart with a she
Message
De
15/12/1999 07:31:32
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00303947
Message ID:
00303957
Vues:
26
Martin,

Have you tried the following?

Open Excel.
Tools | Macro | Record New Macro
Fill some cells, insert a chart, change the colors, etc.
Click the square "Stop Recording" on the little macro toolbar.
Tools | Macros | Macro..., choose the one you just made, Edit

Look at the VBA code you have just created. With a little editing, you can use this in VFP. If you need some special editing on your chart, go back to Excel, record again, and see what you get.

If your chart will always be the same you can just paste in your new data and print the chart.

I hope this gets you started.

One more thing - while in development at least, do appOLE.Visible = .T. Otherwise, every time you crash you will leave another (invisible) instance of Excel open. Your machine will very quickly run out of space and crash. Ask me how I know this!



>I have created a program within FoxPro 5.0 that uses OLE automation to populate cells within Excel 97. I have tried to create a chart within the sheet that contains this data but with no success. Has anyone experienced similar problems or knows of a way of creating a chart - and choosing the style, format, legends etc.
>
>appOLE = CREATEOBJECT("Excel.Application") && Create OLE Object
>
>appOLE.Cells(12,2).Value = "April"
>appOLE.Cells(13,2).Value = "May"
>appOLE.Cells(14,2).Value = "June"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform