ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search ideas to by pass Bug "OnAction" with parameters XP/ XL2K SP3 (https://www.excelbanter.com/excel-programming/418066-search-ideas-pass-bug-onaction-parameters-xp-xl2k-sp3.html)

john2

Search ideas to by pass Bug "OnAction" with parameters XP/ XL2K SP3
 
I am searching any ideas to by pass the bug with "OnAction" with
parameters on XL 2000 SP3
The bug is that nothing is happening consecutively to a click on a
custom Control Button menu.
It's work fine with XL 2000 SP2 and XL2003, unfortunatuly I have to
use XL 2000 SP3.
In my code there is a lot of control menu button affected with this
action property. If I can't pass the parameters to my Sub, I will have
to write as many Sub as existing cases (800 Sub in my example).
Is there another light method to solve this difficulty?
My program in a few words is:
On the current Cell selected I would want to affect to this one, a
specific list. This specific list is chosen with the help of a button
menu (msoControlButton) located in a tree menu.

My code structure is:

Sub CreatMenuNiveauTapRoom(NiveauSec, VarObj3, i, j)
For i = 1 To 20
For j = 1 To 12
VarObj2 = VarObj1 & ".Room" & j
Set VarObj2 = VarOjb1.Controls.Add(Type:=msoControlButton)
TapRefRoom = "TapRefRoom" & j & NiveauSec & i

With VarObj2
.Caption = "Tap." & NiveauSec & ".BL" & i & ".Room" & j
'Passage de 3 paramètres à la procédure Insertlist
.OnAction = "'InsertList """ & NiveauSec & """,""" & i &
""",""" & j & """'"
End With

Next j
Next i
End Sub

Sub InsertList(NiveauSec, i, j)

TapRefRoom = "TapRefRoom" & j & NiveauSec & i
With Selection.Validation
.Delete

.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=" & TapRefRoom

End With
End Sub

Thanks to any advises


Jean.



All times are GMT +1. The time now is 04:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com