Kamis, 06 November 2025

HTML - VBSCRIPT - EXCEL CHART - MICROSOFT OFFICE INTEROP...

 





<HTML>

<BODY>

<h1>HTML + VBSCRIPT + Microsoft Office Excel Interop...</h1>

<INPUT id=button1 name=button1 type=button value="Tampilkan Excel Chart">


<SCRIPT LANGUAGE="VBScript">


       sub button1_onclick()


          ' Launch Excel

          dim app

          set app = createobject("Excel.Application")

    

          ' Make it visible

          app.Visible = true

    

          ' Add a new workbook

          dim wb

          set wb = app.workbooks.add

    

          ' Fill array of values first...

          dim arr(19,9) ' Note: VBScript is zero-based

          for i = 1 to 20

             for j = 1 to 10

                arr(i-1,j-1) = i*j

             next

          next

    

          ' Declare a range object to hold our data

          dim rng

          set rng = wb.Activesheet.Range("A1").Resize(20,10)

    

          ' Now assign them all in one shot...

          rng.value = arr

    

          ' Add a new chart based on the data

          wb.Charts.Add

          wb.ActiveChart.ChartType = 98

          wb.ActiveChart.SetSourceData rng, 2 ' xlColumns

          wb.ActiveChart.Location 2, "Sheet1" 'xlLocationAsObject

    

          ' Rotate it around...

          for i = 1 to 360 step 30

             wb.activechart.rotation = i

          next


          ' Give the user control of Excel

          app.UserControl = true


       end sub

</SCRIPT>


</BODY>

</HTML>






XlChartType enumeration (Excel)

Specifies the chart type.

NameValueDescription
xl3DArea-40983D Area.
xl3DAreaStacked783D Stacked Area.
xl3DAreaStacked10079100% Stacked Area.
xl3DBarClustered603D Clustered Bar.
xl3DBarStacked613D Stacked Bar.
xl3DBarStacked100623D 100% Stacked Bar.
xl3DColumn-41003D Column.
xl3DColumnClustered543D Clustered Column.
xl3DColumnStacked553D Stacked Column.
xl3DColumnStacked100563D 100% Stacked Column.
xl3DLine-41013D Line.
xl3DPie-41023D Pie.
xl3DPieExploded70Exploded 3D Pie.
xlArea1Area.
xlAreaEx135Area Ex.
xlAreaStacked76Stacked Area.
xlAreaStacked10077100% Stacked Area.
xlAreaStacked100Ex137100% Stacked Area Ex.
xlAreaStackedEx136Stacked Area Ex.
xlBarClustered57Clustered Bar.
xlBarClusteredEx132Clustered Bar Ex.
xlBarOfPie71Bar of Pie.
xlBarStacked58Stacked Bar.
xlBarStacked10059100% Stacked Bar.
xlBarStacked100Ex134100% Stacked Bar Ex.
xlBarStackedEx133Stacked Bar Ex.
xlBoxwhisker121Box & Whisker.
xlBubble15Bubble.
xlBubble3DEffect87Bubble with 3D effects.
xlBubbleEx139Bubble Ex.
xlColumnClustered51Clustered Column.
xlColumnClusteredEx124Clustered Column Ex.
xlColumnStacked52Stacked Column.
xlColumnStacked10053100% Stacked Column.
xlColumnStacked100Ex126100% Stacked Column Ex.
xlColumnStackedEx125Stacked Column Ex.
xlCombo-4152Custom Combination.
xlComboAreaStackedColumnClustered115Stacked Area - Clustered Column.
xlComboColumnClusteredLine113Clustered Column - Line.
xlComboColumnClusteredLineSecondaryAxis114Clustered Column - Line on Secondary Axis.
xlConeBarClustered102Clustered Cone Bar.
xlConeBarStacked103Stacked Cone Bar.
xlConeBarStacked100104100% Stacked Cone Bar.
xlConeCol1053D Cone Column.
xlConeColClustered99Clustered Cone Column.
xlConeColStacked100Stacked Cone Column.
xlConeColStacked100101100% Stacked Cone Column.
xlCylinderBarClustered95Clustered Cylinder Bar.
xlCylinderBarStacked96Stacked Cylinder Bar.
xlCylinderBarStacked10097100% Stacked Cylinder Bar.
xlCylinderCol983D Cylinder Column.
xlCylinderColClustered92Clustered Cone Column.
xlCylinderColStacked93Stacked Cone Column.
xlCylinderColStacked10094100% Stacked Cylinder Column.
xlDoughnut-4120Doughnut.
xlDoughnutEx131Doughnut Ex.
xlDoughnutExploded80Exploded Doughnut.
xlFunnel123Funnel.
xlHistogram118Histogram
xlLine4Line.
xlLineEx127Line Ex.
xlLineMarkers65Line with Markers.
xlLineMarkersStacked66Stacked Line with Markers.
xlLineMarkersStacked10067100% Stacked Line with Markers.
xlLineStacked63Stacked Line.
xlLineStacked10064100% Stacked Line.
xlLineStacked100Ex129100% Stacked Line Ex.
xlLineStackedEx128Stacked Line Ex.
xlOtherCombinations116Other Combinations.
xlPareto122Pareto.
xlPie5Pie.
xlPieEx130Pie Ex.
xlPieExploded69Exploded Pie.
xlPieOfPie68Pie of Pie.
xlPyramidBarClustered109Clustered Pyramid Bar.
xlPyramidBarStacked110Stacked Pyramid Bar.
xlPyramidBarStacked100111100% Stacked Pyramid Bar.
xlPyramidCol1123D Pyramid Column.
xlPyramidColClustered106Clustered Pyramid Column.
xlPyramidColStacked107Stacked Pyramid Column.
xlPyramidColStacked100108100% Stacked Pyramid Column.
xlRadar-4151Radar.
xlRadarFilled82Filled Radar.
xlRadarMarkers81Radar with Data Markers.
xlRegionMap140Map chart.
xlStockHLC88High-Low-Close.
xlStockOHLC89Open-High-Low-Close.
xlStockVHLC90Volume-High-Low-Close.
xlStockVOHLC91Volume-Open-High-Low-Close.
xlSuggestedChart-2Suggested.
xlSunburst120Sunburst.
xlSurface833D Surface.
xlSurfaceTopView85Surface (Top View).
xlSurfaceTopViewWireframe86Surface (Top View wireframe).
xlSurfaceWireframe843D Surface (wireframe).
xlTreemap117Treemap.
xlWaterfall119Waterfall.
xlXYScatter-4169Scatter.
xlXYScatterEx138Scatter Ex.
xlXYScatterLines74Scatter with Lines.
xlXYScatterLinesNoMarkers75Scatter with Lines and No Data Markers.
xlXYScatterSmooth72Scatter with Smoothed Lines.
xlXYScatterSmoothNoMarkers73Scatter with Smoothed Lines and No Data Markers.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

Tidak ada komentar: