.


:




:

































 

 

 

 


Excel.Chart, VBA, ,

Excel . , , . ( , ) .

Excel . , Excel ( -> ), (Chart) Chart. Excel Diagram, (, Excel -> ). , Excel .

Excel Chart.

:

Dim oChart As Chart

. Add() Charts:

Set oChart = ActiveWorkbook.Charts.Add(, ActiveSheet)

, , , , . , :

( ) , SetSourceData(). Range ( ). () , . , :

oChart.SetSourceData(Sheets("1").Range("A1:A10"))

, , . . ( " ", ). ChartType, 73 . , , :

oChart.ChartType = xlLineMarkers

. Series , Values ( Range):

Dim oSeries As Series

Set oSeries = oChart.SeriesCollection.NewSeries

oSeries.Values = Worksheets(1).Range("B1:B10")

, , , . . , , Location. , , :

oChart.Location xlLocationAsObject, "1"

, Location (xlLocationAsNewSheet , xlLocationAsObject , ), , , . , Excel, .

, Location, , , . Chart "Automation Error". Location , . , :

Dim oSeries As Series

Set oSeries = Worksheets(1).ChartObjects(1).Chart.SeriesCollection.NewSeries

oSeries.Values = Worksheets(1).Range("B1:B10")

, , .

Chart:

ChartArea ChartArea, , ( Font, Interior ..). , , , PlotArea. . , Top, Height, Left Width ChartArea.

ChartTitle , ( , Text, Font, Border ..);

ChartType , . ;

HasDataTable True, ( ) , . DataTable, . HasLegend, HasPivotFields HasTitle.

Name ( Excel). "1", "2" ..

SizeWithWindow True ( False), , .

Tab , . Excel ( ). , ,

oChart.Tab.Color = RGB(0, 255, 0)

Visible .

.

Chart:

Activate() . ( );

ApplyCustomType() ( );

ApplyDataLabels() . , ( ..);

Axes() , . ;

ChartWizard() , . , ;

Copy() (, , ). Location() Move().

CopyPicture() , . , , Word . Export(), , , .

Delete() ;

Evaluate() , ;

PrintOut() . , ;

Refresh() , , ;

Select() ( ). Deselect() ( <Esc>);

SetBackgroundPicture() "" . , ;

SetSourceData() , , . .

Chart " " , / , , , .., .

 



<== | ==>
- - | 5 .
:


: 2016-10-07; !; : 599 |


:

:

, .
==> ...

1779 - | 1647 -


© 2015-2024 lektsii.org - -

: 0.013 .