How do I fix this SlicerCache object error?
up vote
0
down vote
favorite
Error 424 - "Object required" on the "If Not" line.
I've tried to read up on this error but I am not familiar enough with the SlicerCache to figure this one out - can anyone assist please?
Dim dStartDate As Date
Dim dEndDate As Date
Dim sDateRange As String
Dim sDateRange_Num As String
Dim sDateRangeHeader As String
If Not ActiveWorbook.SlicerCaches("NativeTimeline_Date").FilterCleared = False Then
dStartDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date").TimelineState.FilterValue1
dEndDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date").TimelineState.FilterValue2
sDateRange = dStartDate & " - " & dEndDate
sDateRangeHeader = "Reporting Period: " & sDateRange & " (" & dEndDate - dStartDate & " Days)"
sDateRange_Num = dEndDate - dStartDate
Else
dStartDate = WorksheetFunction.Min(Range("D1:D100"))
dEndDate = WorksheetFunction.Max(Range("D1:D100"))
sDateRange = dStartDate & " - " & dEndDate
sDateRangeHeader = "Reporting Period: " & sDateRange & " (" & dEndDate - dStartDate & " Days)"
sDateRange_Num = dEndDate - dStartDate
End If
excel vba slicers
add a comment |
up vote
0
down vote
favorite
Error 424 - "Object required" on the "If Not" line.
I've tried to read up on this error but I am not familiar enough with the SlicerCache to figure this one out - can anyone assist please?
Dim dStartDate As Date
Dim dEndDate As Date
Dim sDateRange As String
Dim sDateRange_Num As String
Dim sDateRangeHeader As String
If Not ActiveWorbook.SlicerCaches("NativeTimeline_Date").FilterCleared = False Then
dStartDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date").TimelineState.FilterValue1
dEndDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date").TimelineState.FilterValue2
sDateRange = dStartDate & " - " & dEndDate
sDateRangeHeader = "Reporting Period: " & sDateRange & " (" & dEndDate - dStartDate & " Days)"
sDateRange_Num = dEndDate - dStartDate
Else
dStartDate = WorksheetFunction.Min(Range("D1:D100"))
dEndDate = WorksheetFunction.Max(Range("D1:D100"))
sDateRange = dStartDate & " - " & dEndDate
sDateRangeHeader = "Reporting Period: " & sDateRange & " (" & dEndDate - dStartDate & " Days)"
sDateRange_Num = dEndDate - dStartDate
End If
excel vba slicers
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Error 424 - "Object required" on the "If Not" line.
I've tried to read up on this error but I am not familiar enough with the SlicerCache to figure this one out - can anyone assist please?
Dim dStartDate As Date
Dim dEndDate As Date
Dim sDateRange As String
Dim sDateRange_Num As String
Dim sDateRangeHeader As String
If Not ActiveWorbook.SlicerCaches("NativeTimeline_Date").FilterCleared = False Then
dStartDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date").TimelineState.FilterValue1
dEndDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date").TimelineState.FilterValue2
sDateRange = dStartDate & " - " & dEndDate
sDateRangeHeader = "Reporting Period: " & sDateRange & " (" & dEndDate - dStartDate & " Days)"
sDateRange_Num = dEndDate - dStartDate
Else
dStartDate = WorksheetFunction.Min(Range("D1:D100"))
dEndDate = WorksheetFunction.Max(Range("D1:D100"))
sDateRange = dStartDate & " - " & dEndDate
sDateRangeHeader = "Reporting Period: " & sDateRange & " (" & dEndDate - dStartDate & " Days)"
sDateRange_Num = dEndDate - dStartDate
End If
excel vba slicers
Error 424 - "Object required" on the "If Not" line.
I've tried to read up on this error but I am not familiar enough with the SlicerCache to figure this one out - can anyone assist please?
Dim dStartDate As Date
Dim dEndDate As Date
Dim sDateRange As String
Dim sDateRange_Num As String
Dim sDateRangeHeader As String
If Not ActiveWorbook.SlicerCaches("NativeTimeline_Date").FilterCleared = False Then
dStartDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date").TimelineState.FilterValue1
dEndDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date").TimelineState.FilterValue2
sDateRange = dStartDate & " - " & dEndDate
sDateRangeHeader = "Reporting Period: " & sDateRange & " (" & dEndDate - dStartDate & " Days)"
sDateRange_Num = dEndDate - dStartDate
Else
dStartDate = WorksheetFunction.Min(Range("D1:D100"))
dEndDate = WorksheetFunction.Max(Range("D1:D100"))
sDateRange = dStartDate & " - " & dEndDate
sDateRangeHeader = "Reporting Period: " & sDateRange & " (" & dEndDate - dStartDate & " Days)"
sDateRange_Num = dEndDate - dStartDate
End If
excel vba slicers
excel vba slicers
asked Nov 10 at 20:28
kroy2008
697
697
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
You need a k in ActiveWorkbook. Always use Option Explicit at the top of your modules to catch these errors.
ActiveWorkbook.SlicerCaches("NativeTimeline_Date").FilterCleared
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You need a k in ActiveWorkbook. Always use Option Explicit at the top of your modules to catch these errors.
ActiveWorkbook.SlicerCaches("NativeTimeline_Date").FilterCleared
add a comment |
up vote
1
down vote
accepted
You need a k in ActiveWorkbook. Always use Option Explicit at the top of your modules to catch these errors.
ActiveWorkbook.SlicerCaches("NativeTimeline_Date").FilterCleared
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You need a k in ActiveWorkbook. Always use Option Explicit at the top of your modules to catch these errors.
ActiveWorkbook.SlicerCaches("NativeTimeline_Date").FilterCleared
You need a k in ActiveWorkbook. Always use Option Explicit at the top of your modules to catch these errors.
ActiveWorkbook.SlicerCaches("NativeTimeline_Date").FilterCleared
answered Nov 10 at 21:25
QHarr
25.6k81839
25.6k81839
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243118%2fhow-do-i-fix-this-slicercache-object-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown