-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProtectionActions.vb
More file actions
36 lines (28 loc) · 1.15 KB
/
ProtectionActions.vb
File metadata and controls
36 lines (28 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Imports DevExpress.Spreadsheet
Imports DevExpress.Spreadsheet.Charts
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Namespace SpreadsheetChartAPISamples
Public NotInheritable Class ProtectionActions
Private Sub New()
End Sub
Public Shared ProtectChartAction As Action(Of Workbook) = AddressOf ProtectChart
Private Shared Sub ProtectChart(ByVal workbook As Workbook)
#Region "#ProtectChart"
Dim worksheet As Worksheet = workbook.Worksheets("chartTask3")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B2:D4"))
chart.TopLeftCell = worksheet.Cells("H2")
chart.BottomRightCell = worksheet.Cells("N14")
' Specify the chart style.
chart.Style = ChartStyle.ColorDark
' Apply the chart protection.
chart.Options.Protection = ChartProtection.All
#End Region ' #ProtectChart
End Sub
End Class
End Namespace