M
majikman
Private Sub viewDS()
With Application.CommandBars.ActionControl
If ActiveWorkbook.Charts("DS SALES$").Visible = xlSheetVisibl
Then
.State = msoButtonUp
'If .State = msoButtonUp Then
ActiveWorkbook.Charts("DS SALES$").Visible
xlSheetVeryHidden
.State = msoButtonUp
ActiveWorkbook.Charts("DS MARGIN$").Visible
xlSheetVeryHidden
.State = msoButtonUp
ActiveWorkbook.Charts("DS Cumm Sales $").Visible
xlSheetVeryHidden
.State = msoButtonUp
ActiveWorkbook.Charts("DS Cumm Marg $").Visible
xlSheetVeryHidden
.State = msoButtonUp
Else
ActiveWorkbook.Charts("DS SALES$").Visible
xlSheetVisible
* .State = msoButtonDown
ActiveWorkbook.Charts("DS MARGIN$").Visible
xlSheetVisible
.State = msoButtonDown
ActiveWorkbook.Charts("DS Cumm Sales $").Visible
xlSheetVisible
.State = msoButtonDown
ActiveWorkbook.Charts("DS Cumm Marg $").Visible
xlSheetVisible
.State = msoButtonDown
End If
End With
End Sub
This snipet of code crashes on the line I have marked with an asterik
It gives me the error Object variable or With block variable not set
I've declared the with at the very top though so I don't understand wh
this is crashing. Can someone help me out
With Application.CommandBars.ActionControl
If ActiveWorkbook.Charts("DS SALES$").Visible = xlSheetVisibl
Then
.State = msoButtonUp
'If .State = msoButtonUp Then
ActiveWorkbook.Charts("DS SALES$").Visible
xlSheetVeryHidden
.State = msoButtonUp
ActiveWorkbook.Charts("DS MARGIN$").Visible
xlSheetVeryHidden
.State = msoButtonUp
ActiveWorkbook.Charts("DS Cumm Sales $").Visible
xlSheetVeryHidden
.State = msoButtonUp
ActiveWorkbook.Charts("DS Cumm Marg $").Visible
xlSheetVeryHidden
.State = msoButtonUp
Else
ActiveWorkbook.Charts("DS SALES$").Visible
xlSheetVisible
* .State = msoButtonDown
ActiveWorkbook.Charts("DS MARGIN$").Visible
xlSheetVisible
.State = msoButtonDown
ActiveWorkbook.Charts("DS Cumm Sales $").Visible
xlSheetVisible
.State = msoButtonDown
ActiveWorkbook.Charts("DS Cumm Marg $").Visible
xlSheetVisible
.State = msoButtonDown
End If
End With
End Sub
This snipet of code crashes on the line I have marked with an asterik
It gives me the error Object variable or With block variable not set
I've declared the with at the very top though so I don't understand wh
this is crashing. Can someone help me out