excel - Custom menu Passing a WorkSheet variable through .OnAction -
i have been using post guide pass variables until excel, vba: how pass multiple variables .onaction
and has worked well. unfortunately, trying pass worksheet argument time, , not working. here block of code can take look. right click menu:
menu.controls.add(temporary:=true, type:=msocontrolbutton, before:=i_menu) .begingroup = false ' ' ' ' ' ' .onaction = "'" & thisworkbook.name & "'!" & "'saute """ & num_doc & """,""" & num_etape & """'" .onaction = "'" & thisworkbook.name & "'!" & "'saute """ & num_doc & """,""" & num_etape & """,""" & ws & """'" .faceid = 478 .caption = "sauté" .tag = "commande_custom" end
the line multiple apostrophes old line, working. added worksheet argument under it. reference, saute
sub, , arguments (num_doc string, num_etape string, ws worksheet). have tried using 2 fewer quotation marks both left , right of ws, no avail. can figure out how send, and/or propose way of sending information sub (be string or else)?
apparently, after fiddling it, figured out worksheet takes not one, not three, 2 quotations around it. numeric variables , variants taking 1 pair of quotations, , strings taking 3. resolved line:
.onaction = "'" & thisworkbook.name & "'!" & "'saute """ & num_doc & """,""" & num_etape & ""","" & ws & ""'"
Comments
Post a Comment