Dr. Demento
Well-known Member
- Joined
- Nov 2, 2010
- Messages
- 618
- Office Version
- 2019
- 2016
- Platform
- Windows
I'm running a sub from PERSONAL.XLSB that assigns a DropDown to the active sheet. Below is how it's being assigned.
The problem comes on the execution of the .OnAction statement - the sub just quits; no errors. First of all, .OnAction doesn't show up in IntelliSense (but all the other options/methods are present). Am I missing a reference??
Does the code need to reside in the active worksheet instead of PERSONAL.XLSB?? The code originates and is modified from Emulate Excel Pivot Tables with Texts in the Value Area using VBA and this command works fine in the linked file. I'm NOT passing variables and the sub referenced in the .OnAction command is in the same module.
I even attempt to push thru any error using On Error Resume Next and the sub still quits. I've tried assigning data to the dropdown either before or after the .OnAction -- no joy!
I have no earthly idea what's going wrong.
Code:
Dim ddFilterDropDown As dropdown
' Add a new filter dropdown
Set ddFilterDropDown = rngDest.Parent.Shapes.AddFormControl(xlDropDown, _
Left:=rngDest.OffSet(0, 1).Left, _
Top:=rngDest.OffSet(0, 1).Top, _
Width:=rngDest.OffSet(0, 1).Resize(1, 2).Columns.Width, _
Height:=rngDest.rows.Height).OLEFormat.Object
With ddFilterDropDown
.name = "pvtFilterDropDown"
.OnAction = "UpdateFilterDropDown"
End With
The problem comes on the execution of the .OnAction statement - the sub just quits; no errors. First of all, .OnAction doesn't show up in IntelliSense (but all the other options/methods are present). Am I missing a reference??
Does the code need to reside in the active worksheet instead of PERSONAL.XLSB?? The code originates and is modified from Emulate Excel Pivot Tables with Texts in the Value Area using VBA and this command works fine in the linked file. I'm NOT passing variables and the sub referenced in the .OnAction command is in the same module.
I even attempt to push thru any error using On Error Resume Next and the sub still quits. I've tried assigning data to the dropdown either before or after the .OnAction -- no joy!
I have no earthly idea what's going wrong.
Last edited: