如何确定自己的进程是否启用了SeDebugPrivilege?
答案 0 :(得分:4)
这是解决方案,如果有人需要的话。
app-footer
此代码列出了所有特权,如果已禁用,默认启用或启用,则列出所有特权。 经过一些搜索和修改后,此代码可以正常工作。
如果需要列出所有特权,只需在行中注释
Dim arr(2) As String
Dim mySourceData As Range
Dim myChart As Chart
Dim myShape As Shape
Dim myChartDestination As Range
Dim myWorksheet As Worksheet
Set myWorksheet = ActiveSheet
'Data area for each chart
arr(1) = "B1:C32"
arr(2) = "B1:B31,D1:D31"
For a = 1 To 2
Set myChartDestination = myWorksheet.Range("D36:H45")
Set myShape = myWorksheet.Shapes.AddChart(Excel.XlChartType.xl3DBarClustered)
Set myChart = myShape.Chart
With myChart
.SetSourceData Source:=myWorksheet.Range(arr(a))
.ChartTitle.Text = "Analise de correlações"
.Legend.Left = 250
.Legend.Width = 300
.Parent.Height = 200
.Parent.Width = 269
.Parent.Left = 95
End With
With myShape
.Height = 325
.Top = 300
.Left = 100 + ((a - 1) * 250)
.Fill.ForeColor.RGB = RGB(230, 225, 220)
.Fill.Solid
End With
Next