athestreet
Gebruiker
- Lid geworden
- 13 nov 2006
- Berichten
- 77
Hallo,
Ik heb een probleempje om een grafiek die net is aangemaakt op te pakken en ergens anders te plaatsen (voorbeeld cel C335). Maar net het laatste stukje heb ik hier een probleem mee. Misschien dat iemand mij hierbij kan helpen.
Onderstuk blauwe stuk zit nu de fout.
Sub Grafiek()
'
' Grafiek Macro
ActiveSheet.Unprotect Password:="klaas"
Range("C316:G328").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("HOOFDBLAD").Range("C316:G328"), _
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="HOOFDBLAD"
ActiveChart.Axes(xlValue).Select
ActiveChart.PlotArea.Select
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = True
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = True
ActiveChart.Legend.Select
Selection.Position = xlBottom
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(2).ChartType = xlLineMarkersStacked
'ActiveSheet.Protect Password:="klaas"
ActiveWindow.Visible = False
ActiveSheet.Activate
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
ActiveWindow.WindowState = xlNormal
ActiveWindow.WindowState = xlMaximized
Range("C335").Select
ActiveSheet.Activate
ActiveChart.Paste
Ik heb een probleempje om een grafiek die net is aangemaakt op te pakken en ergens anders te plaatsen (voorbeeld cel C335). Maar net het laatste stukje heb ik hier een probleem mee. Misschien dat iemand mij hierbij kan helpen.

Onderstuk blauwe stuk zit nu de fout.
Sub Grafiek()
'
' Grafiek Macro
ActiveSheet.Unprotect Password:="klaas"
Range("C316:G328").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("HOOFDBLAD").Range("C316:G328"), _
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="HOOFDBLAD"
ActiveChart.Axes(xlValue).Select
ActiveChart.PlotArea.Select
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = True
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = True
ActiveChart.Legend.Select
Selection.Position = xlBottom
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(2).ChartType = xlLineMarkersStacked
'ActiveSheet.Protect Password:="klaas"
ActiveWindow.Visible = False
ActiveSheet.Activate
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
ActiveWindow.WindowState = xlNormal
ActiveWindow.WindowState = xlMaximized
Range("C335").Select
ActiveSheet.Activate
ActiveChart.Paste