Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use of Excel OLE from VFP
Message
De
01/02/1999 09:27:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
01/02/1999 09:12:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00182405
Message ID:
00182417
Vues:
12
>Hello, can you help me to use the global constants in the excel ole?
>The problem is that using p.e. ... .axis( xlcategory ).axistitle='a', the constant xlcategory isn't defined and i don't know how to define it.
>Thank you from now!.
Ricardo,
Those constants are in files section as I know + on David Frankenbach's web site (http://www.geocities.com/ResearchTriangle/9834/mainfram.htm) + all in wc0993.exe on MS site. If none found :
*!* xlConstants can be found by :
*!* -Open Excel
*!* -Select tools\macro\VB editor
*!* -Press F2 to bring up "Object browser"
*!* -Find needed xlConstant type ie:xlChartType
*!* -On right window click needed Constant ie: xl3DArea
*!* -Below the window constant value is displayed

Here is a sample :
* Part of xlChartType constants
#define xl3DArea 					-4098
#define xl3DColumn					-4100
#define xl3DLine					-4101
#define xl3DPie						-4102
#define xlArea						1
#define xlBubble3DEffect			87
#define xlLine						4
#define xlPie						5
#define xlRadar						-4151
#define xlSurface					83

*** set the LOCALEID to English
nlLocaleId=sys(3004)		&& Save local id
=sys(3006,1033)			&& We will be sending instructions in English 
ox = crea('excel.application')
ox.workbooks.add()
ox.visible = .t.
with ox.activeworkbook.worksheets(1)
	.Cells(1,1).Value = "NumProd1"
	.Cells(1,2).Value = "AMount"
	.Cells(1,3).value = "Quota"
	.Cells(2,1).Value = 113
	.Cells(2,2).Value = 12000
	.Cells(2,3).value = 23
	.Cells(3,1).Value = 254
	.Cells(3,2).Value = 45000
	.Cells(3,3).value = 24
	.Cells(4,1).Value = 165
	.Cells(4,2).Value = 37000
	.Cells(4,3).value = 42
	ox.charts.add()
*	ox.charts(1).chartwizard(.range(.cells(1,1),.cells(4,3)),xl3DColumn,4,1,0,1,1,"","","","")
*	ox.charts(1).chartwizard(.range(.cells(1,1),.cells(4,3)),xl3DColumn)
endwith
#define xlRows 1
#define xlColumns 2
with ox.charts(1)
        .hastitle = .t.
	.haslegend = .t.
	.ChartTitle.caption = "This is chart title"
	.SetSourceData(ox.activeworkbook.worksheets(1).range("A1:C4"), xlColumns)
	.ChartType=xl3DArea
	.plotby = 2
	* Now play with chart format
		#define xlCategory		1
		#define xlValue			2
		#define xlSeriesAxis	3
		With .Axes(xlCategory)
		    .HasTitle = .t.
			.TickLabelSpacing = 10
		    .TickLabels.Font.Size = 8
		    with .AxisTitle
			    .Caption = "This is category title"
			    .Font.Name = "Arial"
			    .Font.Size = 10
			    .Font.Bold = .t.
		    endwith
    	EndWith
		With .Axes(xlSeriesAxis)
		    .HasTitle = .T.
		    with .AxisTitle
			    .Caption = "This is SeriesAxis title"
			    .Font.Size = 8
			    .Font.Bold = .f.
			    .Orientation = 90 && Show 90 degrees rotated
		    endwith
    	EndWith
		With .Axes(xlValue)
		    .HasTitle = .T.
		    with .AxisTitle
			    .Caption = "This is Rotated Value title"
			    .Font.Size = 10
			    .Font.Bold = .f.
			    .Orientation = 90 && Show 90 degrees rotated - clockwise
		    endwith
    	EndWith
    	.charttype = xl3DLine
*    	.PrintOut   && Print chart
*		.ChartArea.copy() && Copy to clipboard
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform