|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
VBScript + Access?
MsgBox PivotTable5.ActiveData.Cells.DetailCells(0,0).Value
Gives an error when I run? |
|
#2
|
||||
|
||||
|
And what error might that be? And is it VBScript or VBA?
|
|
#3
|
|||
|
|||
|
VBScript.
"Wrong number of arguments, or invalid property assignment: 'PivotTable5.ActiveData.Cells'" |
|
#4
|
||||
|
||||
|
I may be wrong, but doesn't the Cells require a row and column?
more info... http://dbforums.com/arch/191/2002/6/399718 |
|
#5
|
|||
|
|||
|
That example is close, but I'm having some trouble adapting it to my situation. My table doesen't have any row or column fields, I just dragged all of my table fields into the 'DataAxis' area.
(The thing that confuses/annoys me about this is how he has ActiveData.RowAxis as part of the expression, but when you go to type it in, RowAxis is missing from the autocomplete dropdown list.) |
|
#6
|
|||
|
|||
|
Apparently, this is the way to do it in VBA. Does anyone know the equivalent expression(s) for VBS?
Dim CellValue Dim ActView As PivotView Dim fldSets As PivotFieldSets Dim Sel As PivotDetailRange Dim RowNum As Long Dim pvDetCell As PivotDetailCell Dim PvCell As PivotCell Set ActView = PvTable.ActiveView Set fldSets = ActView.FieldSets Set Sel = PvTable.selection Set pvDetCell = Sel.BottomRight RowNum = pvDetCell.Row With PvTable.ActiveData Set PvCell = .cells(.RowMembers(0), .ColumnMembers(0)) End With CellValue = PvCell.DetailCells(RowNum, 4).value |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > VBScript + Access? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|