+ Reply to Thread
Results 1 to 22 of 22

How to disable the "Insert Copied Cells" context menu item

  1. #1
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Coen

    See
    http://www.rondebruin.nl/weeknumber.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Coen" <[email protected]> wrote in message news:[email protected]...
    > Hi,
    >
    > When one or more rows are in copy mode, the row(s) can be pasted by means of
    > the contextmenu item (right mouse button): Insert Copied Cells. I need to
    > disable especially this item and also the "Copied Cells" from the Insert
    > menu. Does any one know how to achieve this?
    >




  2. #2
    Coen
    Guest

    How to disable the "Insert Copied Cells" context menu item

    Hi,

    When one or more rows are in copy mode, the row(s) can be pasted by means of
    the contextmenu item (right mouse button): Insert Copied Cells. I need to
    disable especially this item and also the "Copied Cells" from the Insert
    menu. Does any one know how to achieve this?


  3. #3
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    I see that I paste the wrong link
    This is the good one
    http://www.rondebruin.com/menuid.htm

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > Hi Coen
    >
    > See
    > http://www.rondebruin.nl/weeknumber.htm
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> Hi,
    >>
    >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    >> disable especially this item and also the "Copied Cells" from the Insert
    >> menu. Does any one know how to achieve this?
    >>

    >
    >




  4. #4
    Coen
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Ron, thanks for your quick response. Unfortunately I don't think this
    brings the solution. The menu I'm looking for is a context menu and only
    visible during 'copymode'. So if you have any idea's how to disable this
    "Insert Copied Cells" item, please.

    Again: my largest problem is how to disabe the context menu of "Insert
    Copied Cells".

    Regards Coen.


    "Ron de Bruin" wrote:

    > I see that I paste the wrong link
    > This is the good one
    > http://www.rondebruin.com/menuid.htm
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > > Hi Coen
    > >
    > > See
    > > http://www.rondebruin.nl/weeknumber.htm
    > >
    > >
    > > --
    > > Regards Ron de Bruin
    > > http://www.rondebruin.nl
    > >
    > >
    > >
    > > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >> Hi,
    > >>
    > >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    > >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    > >> disable especially this item and also the "Copied Cells" from the Insert
    > >> menu. Does any one know how to achieve this?
    > >>

    > >
    > >

    >
    >
    >


  5. #5
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Coen

    You can find the ID numbers for this.(links on the bottom of the page)
    I will look them up for you this evening.

    But first I put the kids in bed.


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Coen" <[email protected]> wrote in message news:[email protected]...
    > Hi Ron, thanks for your quick response. Unfortunately I don't think this
    > brings the solution. The menu I'm looking for is a context menu and only
    > visible during 'copymode'. So if you have any idea's how to disable this
    > "Insert Copied Cells" item, please.
    >
    > Again: my largest problem is how to disabe the context menu of "Insert
    > Copied Cells".
    >
    > Regards Coen.
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> I see that I paste the wrong link
    >> This is the good one
    >> http://www.rondebruin.com/menuid.htm
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >>
    >> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> > Hi Coen
    >> >
    >> > See
    >> > http://www.rondebruin.nl/weeknumber.htm
    >> >
    >> >
    >> > --
    >> > Regards Ron de Bruin
    >> > http://www.rondebruin.nl
    >> >
    >> >
    >> >
    >> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> >> Hi,
    >> >>
    >> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    >> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    >> >> disable especially this item and also the "Copied Cells" from the Insert
    >> >> menu. Does any one know how to achieve this?
    >> >>
    >> >
    >> >

    >>
    >>
    >>




  6. #6
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Ok

    Here is a example

    Sub TEST()
    On Error Resume Next
    Application.CommandBars("Worksheet Menu Bar").FindControl _
    (ID:=3184, Recursive:=True).Enabled = False

    Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False

    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > Hi Coen
    >
    > You can find the ID numbers for this.(links on the bottom of the page)
    > I will look them up for you this evening.
    >
    > But first I put the kids in bed.
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    >> brings the solution. The menu I'm looking for is a context menu and only
    >> visible during 'copymode'. So if you have any idea's how to disable this
    >> "Insert Copied Cells" item, please.
    >>
    >> Again: my largest problem is how to disabe the context menu of "Insert
    >> Copied Cells".
    >>
    >> Regards Coen.
    >>
    >>
    >> "Ron de Bruin" wrote:
    >>
    >>> I see that I paste the wrong link
    >>> This is the good one
    >>> http://www.rondebruin.com/menuid.htm
    >>>
    >>> --
    >>> Regards Ron de Bruin
    >>> http://www.rondebruin.nl
    >>>
    >>>
    >>>
    >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >>> > Hi Coen
    >>> >
    >>> > See
    >>> > http://www.rondebruin.nl/weeknumber.htm
    >>> >
    >>> >
    >>> > --
    >>> > Regards Ron de Bruin
    >>> > http://www.rondebruin.nl
    >>> >
    >>> >
    >>> >
    >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >>> >> Hi,
    >>> >>
    >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    >>> >> disable especially this item and also the "Copied Cells" from the Insert
    >>> >> menu. Does any one know how to achieve this?
    >>> >>
    >>> >
    >>> >
    >>>
    >>>
    >>>

    >
    >




  7. #7
    Coen
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Thanks Ron, you helped me a lot.
    The only issue yet left is:

    This item is in:
    CommandBar: Cell ID = 3185
    CommandBar: Row ID = 3187
    CommandBar: Worksheet Menu Bar(recursive) ID = 3184

    At opening a spec. Excel-book I need to disable ALL this three items. But it
    looks like they are not always available. It looks like you have to be in a
    sort of 'Cell copy mode' or in 'Row copy mode' to be able to disable the
    items.

    Any ideas about this?

    Coen




    "Ron de Bruin" wrote:

    > Ok
    >
    > Here is a example
    >
    > Sub TEST()
    > On Error Resume Next
    > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > (ID:=3184, Recursive:=True).Enabled = False
    >
    > Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    >
    > End Sub
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > > Hi Coen
    > >
    > > You can find the ID numbers for this.(links on the bottom of the page)
    > > I will look them up for you this evening.
    > >
    > > But first I put the kids in bed.
    > >
    > >
    > > --
    > > Regards Ron de Bruin
    > > http://www.rondebruin.nl
    > >
    > >
    > >
    > > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    > >> brings the solution. The menu I'm looking for is a context menu and only
    > >> visible during 'copymode'. So if you have any idea's how to disable this
    > >> "Insert Copied Cells" item, please.
    > >>
    > >> Again: my largest problem is how to disabe the context menu of "Insert
    > >> Copied Cells".
    > >>
    > >> Regards Coen.
    > >>
    > >>
    > >> "Ron de Bruin" wrote:
    > >>
    > >>> I see that I paste the wrong link
    > >>> This is the good one
    > >>> http://www.rondebruin.com/menuid.htm
    > >>>
    > >>> --
    > >>> Regards Ron de Bruin
    > >>> http://www.rondebruin.nl
    > >>>
    > >>>
    > >>>
    > >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > >>> > Hi Coen
    > >>> >
    > >>> > See
    > >>> > http://www.rondebruin.nl/weeknumber.htm
    > >>> >
    > >>> >
    > >>> > --
    > >>> > Regards Ron de Bruin
    > >>> > http://www.rondebruin.nl
    > >>> >
    > >>> >
    > >>> >
    > >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >>> >> Hi,
    > >>> >>
    > >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    > >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    > >>> >> disable especially this item and also the "Copied Cells" from the Insert
    > >>> >> menu. Does any one know how to achieve this?
    > >>> >>
    > >>> >
    > >>> >
    > >>>
    > >>>
    > >>>

    > >
    > >

    >
    >
    >


  8. #8
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    > looks like they are not always available
    That's correct

    If there is something on the Clipboard they are available
    But it is working for me with the test macro

    I will test more tomorrow(bed time for me now)



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Coen" <[email protected]> wrote in message news:[email protected]...
    > Thanks Ron, you helped me a lot.
    > The only issue yet left is:
    >
    > This item is in:
    > CommandBar: Cell ID = 3185
    > CommandBar: Row ID = 3187
    > CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    >
    > At opening a spec. Excel-book I need to disable ALL this three items. But it
    > looks like they are not always available. It looks like you have to be in a
    > sort of 'Cell copy mode' or in 'Row copy mode' to be able to disable the
    > items.
    >
    > Any ideas about this?
    >
    > Coen
    >
    >
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Ok
    >>
    >> Here is a example
    >>
    >> Sub TEST()
    >> On Error Resume Next
    >> Application.CommandBars("Worksheet Menu Bar").FindControl _
    >> (ID:=3184, Recursive:=True).Enabled = False
    >>
    >> Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    >>
    >> End Sub
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >>
    >> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> > Hi Coen
    >> >
    >> > You can find the ID numbers for this.(links on the bottom of the page)
    >> > I will look them up for you this evening.
    >> >
    >> > But first I put the kids in bed.
    >> >
    >> >
    >> > --
    >> > Regards Ron de Bruin
    >> > http://www.rondebruin.nl
    >> >
    >> >
    >> >
    >> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    >> >> brings the solution. The menu I'm looking for is a context menu and only
    >> >> visible during 'copymode'. So if you have any idea's how to disable this
    >> >> "Insert Copied Cells" item, please.
    >> >>
    >> >> Again: my largest problem is how to disabe the context menu of "Insert
    >> >> Copied Cells".
    >> >>
    >> >> Regards Coen.
    >> >>
    >> >>
    >> >> "Ron de Bruin" wrote:
    >> >>
    >> >>> I see that I paste the wrong link
    >> >>> This is the good one
    >> >>> http://www.rondebruin.com/menuid.htm
    >> >>>
    >> >>> --
    >> >>> Regards Ron de Bruin
    >> >>> http://www.rondebruin.nl
    >> >>>
    >> >>>
    >> >>>
    >> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> >>> > Hi Coen
    >> >>> >
    >> >>> > See
    >> >>> > http://www.rondebruin.nl/weeknumber.htm
    >> >>> >
    >> >>> >
    >> >>> > --
    >> >>> > Regards Ron de Bruin
    >> >>> > http://www.rondebruin.nl
    >> >>> >
    >> >>> >
    >> >>> >
    >> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> >>> >> Hi,
    >> >>> >>
    >> >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    >> >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    >> >>> >> disable especially this item and also the "Copied Cells" from the Insert
    >> >>> >> menu. Does any one know how to achieve this?
    >> >>> >>
    >> >>> >
    >> >>> >
    >> >>>
    >> >>>
    >> >>>
    >> >
    >> >

    >>
    >>
    >>




  9. #9
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Coen

    I see it now also

    I will see if I have time tomorrow to find a solution


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> looks like they are not always available

    > That's correct
    >
    > If there is something on the Clipboard they are available
    > But it is working for me with the test macro
    >
    > I will test more tomorrow(bed time for me now)
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> Thanks Ron, you helped me a lot.
    >> The only issue yet left is:
    >>
    >> This item is in:
    >> CommandBar: Cell ID = 3185
    >> CommandBar: Row ID = 3187
    >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    >>
    >> At opening a spec. Excel-book I need to disable ALL this three items. But it
    >> looks like they are not always available. It looks like you have to be in a
    >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to disable the
    >> items.
    >>
    >> Any ideas about this?
    >>
    >> Coen
    >>
    >>
    >>
    >>
    >> "Ron de Bruin" wrote:
    >>
    >>> Ok
    >>>
    >>> Here is a example
    >>>
    >>> Sub TEST()
    >>> On Error Resume Next
    >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    >>> (ID:=3184, Recursive:=True).Enabled = False
    >>>
    >>> Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    >>>
    >>> End Sub
    >>>
    >>>
    >>> --
    >>> Regards Ron de Bruin
    >>> http://www.rondebruin.nl
    >>>
    >>>
    >>>
    >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >>> > Hi Coen
    >>> >
    >>> > You can find the ID numbers for this.(links on the bottom of the page)
    >>> > I will look them up for you this evening.
    >>> >
    >>> > But first I put the kids in bed.
    >>> >
    >>> >
    >>> > --
    >>> > Regards Ron de Bruin
    >>> > http://www.rondebruin.nl
    >>> >
    >>> >
    >>> >
    >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >>> >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    >>> >> brings the solution. The menu I'm looking for is a context menu and only
    >>> >> visible during 'copymode'. So if you have any idea's how to disable this
    >>> >> "Insert Copied Cells" item, please.
    >>> >>
    >>> >> Again: my largest problem is how to disabe the context menu of "Insert
    >>> >> Copied Cells".
    >>> >>
    >>> >> Regards Coen.
    >>> >>
    >>> >>
    >>> >> "Ron de Bruin" wrote:
    >>> >>
    >>> >>> I see that I paste the wrong link
    >>> >>> This is the good one
    >>> >>> http://www.rondebruin.com/menuid.htm
    >>> >>>
    >>> >>> --
    >>> >>> Regards Ron de Bruin
    >>> >>> http://www.rondebruin.nl
    >>> >>>
    >>> >>>
    >>> >>>
    >>> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >>> >>> > Hi Coen
    >>> >>> >
    >>> >>> > See
    >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    >>> >>> >
    >>> >>> >
    >>> >>> > --
    >>> >>> > Regards Ron de Bruin
    >>> >>> > http://www.rondebruin.nl
    >>> >>> >
    >>> >>> >
    >>> >>> >
    >>> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >>> >>> >> Hi,
    >>> >>> >>
    >>> >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    >>> >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    >>> >>> >> disable especially this item and also the "Copied Cells" from the Insert
    >>> >>> >> menu. Does any one know how to achieve this?
    >>> >>> >>
    >>> >>> >
    >>> >>> >
    >>> >>>
    >>> >>>
    >>> >>>
    >>> >
    >>> >
    >>>
    >>>
    >>>

    >
    >




  10. #10
    Coen
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Ron, would be great! I'll check for answers this evening.
    Thanks anyway.

    "Ron de Bruin" wrote:

    > Hi Coen
    >
    > I see it now also
    >
    > I will see if I have time tomorrow to find a solution
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > >> looks like they are not always available

    > > That's correct
    > >
    > > If there is something on the Clipboard they are available
    > > But it is working for me with the test macro
    > >
    > > I will test more tomorrow(bed time for me now)
    > >
    > >
    > >
    > > --
    > > Regards Ron de Bruin
    > > http://www.rondebruin.nl
    > >
    > >
    > >
    > > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >> Thanks Ron, you helped me a lot.
    > >> The only issue yet left is:
    > >>
    > >> This item is in:
    > >> CommandBar: Cell ID = 3185
    > >> CommandBar: Row ID = 3187
    > >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    > >>
    > >> At opening a spec. Excel-book I need to disable ALL this three items. But it
    > >> looks like they are not always available. It looks like you have to be in a
    > >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to disable the
    > >> items.
    > >>
    > >> Any ideas about this?
    > >>
    > >> Coen
    > >>
    > >>
    > >>
    > >>
    > >> "Ron de Bruin" wrote:
    > >>
    > >>> Ok
    > >>>
    > >>> Here is a example
    > >>>
    > >>> Sub TEST()
    > >>> On Error Resume Next
    > >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    > >>> (ID:=3184, Recursive:=True).Enabled = False
    > >>>
    > >>> Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    > >>>
    > >>> End Sub
    > >>>
    > >>>
    > >>> --
    > >>> Regards Ron de Bruin
    > >>> http://www.rondebruin.nl
    > >>>
    > >>>
    > >>>
    > >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > >>> > Hi Coen
    > >>> >
    > >>> > You can find the ID numbers for this.(links on the bottom of the page)
    > >>> > I will look them up for you this evening.
    > >>> >
    > >>> > But first I put the kids in bed.
    > >>> >
    > >>> >
    > >>> > --
    > >>> > Regards Ron de Bruin
    > >>> > http://www.rondebruin.nl
    > >>> >
    > >>> >
    > >>> >
    > >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >>> >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    > >>> >> brings the solution. The menu I'm looking for is a context menu and only
    > >>> >> visible during 'copymode'. So if you have any idea's how to disable this
    > >>> >> "Insert Copied Cells" item, please.
    > >>> >>
    > >>> >> Again: my largest problem is how to disabe the context menu of "Insert
    > >>> >> Copied Cells".
    > >>> >>
    > >>> >> Regards Coen.
    > >>> >>
    > >>> >>
    > >>> >> "Ron de Bruin" wrote:
    > >>> >>
    > >>> >>> I see that I paste the wrong link
    > >>> >>> This is the good one
    > >>> >>> http://www.rondebruin.com/menuid.htm
    > >>> >>>
    > >>> >>> --
    > >>> >>> Regards Ron de Bruin
    > >>> >>> http://www.rondebruin.nl
    > >>> >>>
    > >>> >>>
    > >>> >>>
    > >>> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > >>> >>> > Hi Coen
    > >>> >>> >
    > >>> >>> > See
    > >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    > >>> >>> >
    > >>> >>> >
    > >>> >>> > --
    > >>> >>> > Regards Ron de Bruin
    > >>> >>> > http://www.rondebruin.nl
    > >>> >>> >
    > >>> >>> >
    > >>> >>> >
    > >>> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >>> >>> >> Hi,
    > >>> >>> >>
    > >>> >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    > >>> >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    > >>> >>> >> disable especially this item and also the "Copied Cells" from the Insert
    > >>> >>> >> menu. Does any one know how to achieve this?
    > >>> >>> >>
    > >>> >>> >
    > >>> >>> >
    > >>> >>>
    > >>> >>>
    > >>> >>>
    > >>> >
    > >>> >
    > >>>
    > >>>
    > >>>

    > >
    > >

    >
    >
    >


  11. #11
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Coen

    It seems that only the Insert menu item is a problem.
    I will test more tomorrow after work.


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Coen" <[email protected]> wrote in message news:[email protected]...
    > Hi Ron, would be great! I'll check for answers this evening.
    > Thanks anyway.
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi Coen
    >>
    >> I see it now also
    >>
    >> I will see if I have time tomorrow to find a solution
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >>
    >> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> >> looks like they are not always available
    >> > That's correct
    >> >
    >> > If there is something on the Clipboard they are available
    >> > But it is working for me with the test macro
    >> >
    >> > I will test more tomorrow(bed time for me now)
    >> >
    >> >
    >> >
    >> > --
    >> > Regards Ron de Bruin
    >> > http://www.rondebruin.nl
    >> >
    >> >
    >> >
    >> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> >> Thanks Ron, you helped me a lot.
    >> >> The only issue yet left is:
    >> >>
    >> >> This item is in:
    >> >> CommandBar: Cell ID = 3185
    >> >> CommandBar: Row ID = 3187
    >> >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    >> >>
    >> >> At opening a spec. Excel-book I need to disable ALL this three items. But it
    >> >> looks like they are not always available. It looks like you have to be in a
    >> >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to disable the
    >> >> items.
    >> >>
    >> >> Any ideas about this?
    >> >>
    >> >> Coen
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> "Ron de Bruin" wrote:
    >> >>
    >> >>> Ok
    >> >>>
    >> >>> Here is a example
    >> >>>
    >> >>> Sub TEST()
    >> >>> On Error Resume Next
    >> >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    >> >>> (ID:=3184, Recursive:=True).Enabled = False
    >> >>>
    >> >>> Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    >> >>>
    >> >>> End Sub
    >> >>>
    >> >>>
    >> >>> --
    >> >>> Regards Ron de Bruin
    >> >>> http://www.rondebruin.nl
    >> >>>
    >> >>>
    >> >>>
    >> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> >>> > Hi Coen
    >> >>> >
    >> >>> > You can find the ID numbers for this.(links on the bottom of the page)
    >> >>> > I will look them up for you this evening.
    >> >>> >
    >> >>> > But first I put the kids in bed.
    >> >>> >
    >> >>> >
    >> >>> > --
    >> >>> > Regards Ron de Bruin
    >> >>> > http://www.rondebruin.nl
    >> >>> >
    >> >>> >
    >> >>> >
    >> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> >>> >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    >> >>> >> brings the solution. The menu I'm looking for is a context menu and only
    >> >>> >> visible during 'copymode'. So if you have any idea's how to disable this
    >> >>> >> "Insert Copied Cells" item, please.
    >> >>> >>
    >> >>> >> Again: my largest problem is how to disabe the context menu of "Insert
    >> >>> >> Copied Cells".
    >> >>> >>
    >> >>> >> Regards Coen.
    >> >>> >>
    >> >>> >>
    >> >>> >> "Ron de Bruin" wrote:
    >> >>> >>
    >> >>> >>> I see that I paste the wrong link
    >> >>> >>> This is the good one
    >> >>> >>> http://www.rondebruin.com/menuid.htm
    >> >>> >>>
    >> >>> >>> --
    >> >>> >>> Regards Ron de Bruin
    >> >>> >>> http://www.rondebruin.nl
    >> >>> >>>
    >> >>> >>>
    >> >>> >>>
    >> >>> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> >>> >>> > Hi Coen
    >> >>> >>> >
    >> >>> >>> > See
    >> >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    >> >>> >>> >
    >> >>> >>> >
    >> >>> >>> > --
    >> >>> >>> > Regards Ron de Bruin
    >> >>> >>> > http://www.rondebruin.nl
    >> >>> >>> >
    >> >>> >>> >
    >> >>> >>> >
    >> >>> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> >>> >>> >> Hi,
    >> >>> >>> >>
    >> >>> >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    >> >>> >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    >> >>> >>> >> disable especially this item and also the "Copied Cells" from the Insert
    >> >>> >>> >> menu. Does any one know how to achieve this?
    >> >>> >>> >>
    >> >>> >>> >
    >> >>> >>> >
    >> >>> >>>
    >> >>> >>>
    >> >>> >>>
    >> >>> >
    >> >>> >
    >> >>>
    >> >>>
    >> >>>
    >> >
    >> >

    >>
    >>
    >>




  12. #12
    Coen
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Ron (and everyone having suggestions),

    Situation is as the following. I'm dealing with an add-in application (.xla
    and Office 2003). At startup of this application (preferrably at the
    Workbook_Open event) I should disable all three "Insert Copied Cells"
    menuitems. This is not as easy as it looks for me because these items are not
    available at startup, so any ideas are more then welcome.


    "Ron de Bruin" wrote:

    > Hi Coen
    >
    > It seems that only the Insert menu item is a problem.
    > I will test more tomorrow after work.
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Coen" <[email protected]> wrote in message news:[email protected]...
    > > Hi Ron, would be great! I'll check for answers this evening.
    > > Thanks anyway.
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi Coen
    > >>
    > >> I see it now also
    > >>
    > >> I will see if I have time tomorrow to find a solution
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >>
    > >> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > >> >> looks like they are not always available
    > >> > That's correct
    > >> >
    > >> > If there is something on the Clipboard they are available
    > >> > But it is working for me with the test macro
    > >> >
    > >> > I will test more tomorrow(bed time for me now)
    > >> >
    > >> >
    > >> >
    > >> > --
    > >> > Regards Ron de Bruin
    > >> > http://www.rondebruin.nl
    > >> >
    > >> >
    > >> >
    > >> > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >> >> Thanks Ron, you helped me a lot.
    > >> >> The only issue yet left is:
    > >> >>
    > >> >> This item is in:
    > >> >> CommandBar: Cell ID = 3185
    > >> >> CommandBar: Row ID = 3187
    > >> >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    > >> >>
    > >> >> At opening a spec. Excel-book I need to disable ALL this three items. But it
    > >> >> looks like they are not always available. It looks like you have to be in a
    > >> >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to disable the
    > >> >> items.
    > >> >>
    > >> >> Any ideas about this?
    > >> >>
    > >> >> Coen
    > >> >>
    > >> >>
    > >> >>
    > >> >>
    > >> >> "Ron de Bruin" wrote:
    > >> >>
    > >> >>> Ok
    > >> >>>
    > >> >>> Here is a example
    > >> >>>
    > >> >>> Sub TEST()
    > >> >>> On Error Resume Next
    > >> >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    > >> >>> (ID:=3184, Recursive:=True).Enabled = False
    > >> >>>
    > >> >>> Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    > >> >>>
    > >> >>> End Sub
    > >> >>>
    > >> >>>
    > >> >>> --
    > >> >>> Regards Ron de Bruin
    > >> >>> http://www.rondebruin.nl
    > >> >>>
    > >> >>>
    > >> >>>
    > >> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > >> >>> > Hi Coen
    > >> >>> >
    > >> >>> > You can find the ID numbers for this.(links on the bottom of the page)
    > >> >>> > I will look them up for you this evening.
    > >> >>> >
    > >> >>> > But first I put the kids in bed.
    > >> >>> >
    > >> >>> >
    > >> >>> > --
    > >> >>> > Regards Ron de Bruin
    > >> >>> > http://www.rondebruin.nl
    > >> >>> >
    > >> >>> >
    > >> >>> >
    > >> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >> >>> >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    > >> >>> >> brings the solution. The menu I'm looking for is a context menu and only
    > >> >>> >> visible during 'copymode'. So if you have any idea's how to disable this
    > >> >>> >> "Insert Copied Cells" item, please.
    > >> >>> >>
    > >> >>> >> Again: my largest problem is how to disabe the context menu of "Insert
    > >> >>> >> Copied Cells".
    > >> >>> >>
    > >> >>> >> Regards Coen.
    > >> >>> >>
    > >> >>> >>
    > >> >>> >> "Ron de Bruin" wrote:
    > >> >>> >>
    > >> >>> >>> I see that I paste the wrong link
    > >> >>> >>> This is the good one
    > >> >>> >>> http://www.rondebruin.com/menuid.htm
    > >> >>> >>>
    > >> >>> >>> --
    > >> >>> >>> Regards Ron de Bruin
    > >> >>> >>> http://www.rondebruin.nl
    > >> >>> >>>
    > >> >>> >>>
    > >> >>> >>>
    > >> >>> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > >> >>> >>> > Hi Coen
    > >> >>> >>> >
    > >> >>> >>> > See
    > >> >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    > >> >>> >>> >
    > >> >>> >>> >
    > >> >>> >>> > --
    > >> >>> >>> > Regards Ron de Bruin
    > >> >>> >>> > http://www.rondebruin.nl
    > >> >>> >>> >
    > >> >>> >>> >
    > >> >>> >>> >
    > >> >>> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    > >> >>> >>> >> Hi,
    > >> >>> >>> >>
    > >> >>> >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    > >> >>> >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    > >> >>> >>> >> disable especially this item and also the "Copied Cells" from the Insert
    > >> >>> >>> >> menu. Does any one know how to achieve this?
    > >> >>> >>> >>
    > >> >>> >>> >
    > >> >>> >>> >
    > >> >>> >>>
    > >> >>> >>>
    > >> >>> >>>
    > >> >>> >
    > >> >>> >
    > >> >>>
    > >> >>>
    > >> >>>
    > >> >
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >


  13. #13
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Coen

    I think the best thing that you can do is to disable "Insert"
    It will disable Inset copeid cells also.

    This seems to work fine, only the row ID for insert is 3181 but this is not working.
    I am searching the real number now.(I post back)

    Sub falsefalse()
    On Error Resume Next
    Application.CommandBars("Worksheet Menu Bar").FindControl _
    (ID:=295, Recursive:=True).Enabled = False

    Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = False
    'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = False
    Application.CommandBars("Column").FindControl(ID:=3183).Enabled = False
    End Sub

    Sub truetrue()
    On Error Resume Next
    Application.CommandBars("Worksheet Menu Bar").FindControl _
    (ID:=295, Recursive:=True).Enabled = True

    Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = True
    'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = True
    Application.CommandBars("Column").FindControl(ID:=3183).Enabled = True
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Coen" <[email protected]> wrote in message news:[email protected]...
    > Hi Ron (and everyone having suggestions),
    >
    > Situation is as the following. I'm dealing with an add-in application (.xla
    > and Office 2003). At startup of this application (preferrably at the
    > Workbook_Open event) I should disable all three "Insert Copied Cells"
    > menuitems. This is not as easy as it looks for me because these items are not
    > available at startup, so any ideas are more then welcome.
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi Coen
    >>
    >> It seems that only the Insert menu item is a problem.
    >> I will test more tomorrow after work.
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >>
    >> "Coen" <[email protected]> wrote in message news:[email protected]...
    >> > Hi Ron, would be great! I'll check for answers this evening.
    >> > Thanks anyway.
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> >> Hi Coen
    >> >>
    >> >> I see it now also
    >> >>
    >> >> I will see if I have time tomorrow to find a solution
    >> >>
    >> >>
    >> >> --
    >> >> Regards Ron de Bruin
    >> >> http://www.rondebruin.nl
    >> >>
    >> >>
    >> >>
    >> >> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> >> >> looks like they are not always available
    >> >> > That's correct
    >> >> >
    >> >> > If there is something on the Clipboard they are available
    >> >> > But it is working for me with the test macro
    >> >> >
    >> >> > I will test more tomorrow(bed time for me now)
    >> >> >
    >> >> >
    >> >> >
    >> >> > --
    >> >> > Regards Ron de Bruin
    >> >> > http://www.rondebruin.nl
    >> >> >
    >> >> >
    >> >> >
    >> >> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> >> >> Thanks Ron, you helped me a lot.
    >> >> >> The only issue yet left is:
    >> >> >>
    >> >> >> This item is in:
    >> >> >> CommandBar: Cell ID = 3185
    >> >> >> CommandBar: Row ID = 3187
    >> >> >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    >> >> >>
    >> >> >> At opening a spec. Excel-book I need to disable ALL this three items. But it
    >> >> >> looks like they are not always available. It looks like you have to be in a
    >> >> >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to disable the
    >> >> >> items.
    >> >> >>
    >> >> >> Any ideas about this?
    >> >> >>
    >> >> >> Coen
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >> "Ron de Bruin" wrote:
    >> >> >>
    >> >> >>> Ok
    >> >> >>>
    >> >> >>> Here is a example
    >> >> >>>
    >> >> >>> Sub TEST()
    >> >> >>> On Error Resume Next
    >> >> >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    >> >> >>> (ID:=3184, Recursive:=True).Enabled = False
    >> >> >>>
    >> >> >>> Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    >> >> >>>
    >> >> >>> End Sub
    >> >> >>>
    >> >> >>>
    >> >> >>> --
    >> >> >>> Regards Ron de Bruin
    >> >> >>> http://www.rondebruin.nl
    >> >> >>>
    >> >> >>>
    >> >> >>>
    >> >> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> >> >>> > Hi Coen
    >> >> >>> >
    >> >> >>> > You can find the ID numbers for this.(links on the bottom of the page)
    >> >> >>> > I will look them up for you this evening.
    >> >> >>> >
    >> >> >>> > But first I put the kids in bed.
    >> >> >>> >
    >> >> >>> >
    >> >> >>> > --
    >> >> >>> > Regards Ron de Bruin
    >> >> >>> > http://www.rondebruin.nl
    >> >> >>> >
    >> >> >>> >
    >> >> >>> >
    >> >> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> >> >>> >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    >> >> >>> >> brings the solution. The menu I'm looking for is a context menu and only
    >> >> >>> >> visible during 'copymode'. So if you have any idea's how to disable this
    >> >> >>> >> "Insert Copied Cells" item, please.
    >> >> >>> >>
    >> >> >>> >> Again: my largest problem is how to disabe the context menu of "Insert
    >> >> >>> >> Copied Cells".
    >> >> >>> >>
    >> >> >>> >> Regards Coen.
    >> >> >>> >>
    >> >> >>> >>
    >> >> >>> >> "Ron de Bruin" wrote:
    >> >> >>> >>
    >> >> >>> >>> I see that I paste the wrong link
    >> >> >>> >>> This is the good one
    >> >> >>> >>> http://www.rondebruin.com/menuid.htm
    >> >> >>> >>>
    >> >> >>> >>> --
    >> >> >>> >>> Regards Ron de Bruin
    >> >> >>> >>> http://www.rondebruin.nl
    >> >> >>> >>>
    >> >> >>> >>>
    >> >> >>> >>>
    >> >> >>> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> >> >>> >>> > Hi Coen
    >> >> >>> >>> >
    >> >> >>> >>> > See
    >> >> >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    >> >> >>> >>> >
    >> >> >>> >>> >
    >> >> >>> >>> > --
    >> >> >>> >>> > Regards Ron de Bruin
    >> >> >>> >>> > http://www.rondebruin.nl
    >> >> >>> >>> >
    >> >> >>> >>> >
    >> >> >>> >>> >
    >> >> >>> >>> > "Coen" <[email protected]> wrote in message
    >> >> >>> >>> > news:[email protected]...
    >> >> >>> >>> >> Hi,
    >> >> >>> >>> >>
    >> >> >>> >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    >> >> >>> >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    >> >> >>> >>> >> disable especially this item and also the "Copied Cells" from the Insert
    >> >> >>> >>> >> menu. Does any one know how to achieve this?
    >> >> >>> >>> >>
    >> >> >>> >>> >
    >> >> >>> >>> >
    >> >> >>> >>>
    >> >> >>> >>>
    >> >> >>> >>>
    >> >> >>> >
    >> >> >>> >
    >> >> >>>
    >> >> >>>
    >> >> >>>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  14. #14
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    It is very strange

    The row and column "Insert" option use the same ID number
    But sometimes it say 3181 and the other time 3183.

    I think there is a bug, I will see if I can find a save workaround


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Ron de Bruin" <[email protected]> wrote in message news:%[email protected]...
    > Hi Coen
    >
    > I think the best thing that you can do is to disable "Insert"
    > It will disable Inset copeid cells also.
    >
    > This seems to work fine, only the row ID for insert is 3181 but this is not working.
    > I am searching the real number now.(I post back)
    >
    > Sub falsefalse()
    > On Error Resume Next
    > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > (ID:=295, Recursive:=True).Enabled = False
    >
    > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = False
    > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = False
    > Application.CommandBars("Column").FindControl(ID:=3183).Enabled = False
    > End Sub
    >
    > Sub truetrue()
    > On Error Resume Next
    > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > (ID:=295, Recursive:=True).Enabled = True
    >
    > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = True
    > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = True
    > Application.CommandBars("Column").FindControl(ID:=3183).Enabled = True
    > End Sub
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Coen" <[email protected]> wrote in message news:[email protected]...
    >> Hi Ron (and everyone having suggestions),
    >>
    >> Situation is as the following. I'm dealing with an add-in application (.xla
    >> and Office 2003). At startup of this application (preferrably at the
    >> Workbook_Open event) I should disable all three "Insert Copied Cells"
    >> menuitems. This is not as easy as it looks for me because these items are not
    >> available at startup, so any ideas are more then welcome.
    >>
    >>
    >> "Ron de Bruin" wrote:
    >>
    >>> Hi Coen
    >>>
    >>> It seems that only the Insert menu item is a problem.
    >>> I will test more tomorrow after work.
    >>>
    >>>
    >>> --
    >>> Regards Ron de Bruin
    >>> http://www.rondebruin.nl
    >>>
    >>>
    >>>
    >>> "Coen" <[email protected]> wrote in message news:[email protected]...
    >>> > Hi Ron, would be great! I'll check for answers this evening.
    >>> > Thanks anyway.
    >>> >
    >>> > "Ron de Bruin" wrote:
    >>> >
    >>> >> Hi Coen
    >>> >>
    >>> >> I see it now also
    >>> >>
    >>> >> I will see if I have time tomorrow to find a solution
    >>> >>
    >>> >>
    >>> >> --
    >>> >> Regards Ron de Bruin
    >>> >> http://www.rondebruin.nl
    >>> >>
    >>> >>
    >>> >>
    >>> >> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >>> >> >> looks like they are not always available
    >>> >> > That's correct
    >>> >> >
    >>> >> > If there is something on the Clipboard they are available
    >>> >> > But it is working for me with the test macro
    >>> >> >
    >>> >> > I will test more tomorrow(bed time for me now)
    >>> >> >
    >>> >> >
    >>> >> >
    >>> >> > --
    >>> >> > Regards Ron de Bruin
    >>> >> > http://www.rondebruin.nl
    >>> >> >
    >>> >> >
    >>> >> >
    >>> >> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >>> >> >> Thanks Ron, you helped me a lot.
    >>> >> >> The only issue yet left is:
    >>> >> >>
    >>> >> >> This item is in:
    >>> >> >> CommandBar: Cell ID = 3185
    >>> >> >> CommandBar: Row ID = 3187
    >>> >> >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    >>> >> >>
    >>> >> >> At opening a spec. Excel-book I need to disable ALL this three items. But it
    >>> >> >> looks like they are not always available. It looks like you have to be in a
    >>> >> >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to disable the
    >>> >> >> items.
    >>> >> >>
    >>> >> >> Any ideas about this?
    >>> >> >>
    >>> >> >> Coen
    >>> >> >>
    >>> >> >>
    >>> >> >>
    >>> >> >>
    >>> >> >> "Ron de Bruin" wrote:
    >>> >> >>
    >>> >> >>> Ok
    >>> >> >>>
    >>> >> >>> Here is a example
    >>> >> >>>
    >>> >> >>> Sub TEST()
    >>> >> >>> On Error Resume Next
    >>> >> >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    >>> >> >>> (ID:=3184, Recursive:=True).Enabled = False
    >>> >> >>>
    >>> >> >>> Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    >>> >> >>>
    >>> >> >>> End Sub
    >>> >> >>>
    >>> >> >>>
    >>> >> >>> --
    >>> >> >>> Regards Ron de Bruin
    >>> >> >>> http://www.rondebruin.nl
    >>> >> >>>
    >>> >> >>>
    >>> >> >>>
    >>> >> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >>> >> >>> > Hi Coen
    >>> >> >>> >
    >>> >> >>> > You can find the ID numbers for this.(links on the bottom of the page)
    >>> >> >>> > I will look them up for you this evening.
    >>> >> >>> >
    >>> >> >>> > But first I put the kids in bed.
    >>> >> >>> >
    >>> >> >>> >
    >>> >> >>> > --
    >>> >> >>> > Regards Ron de Bruin
    >>> >> >>> > http://www.rondebruin.nl
    >>> >> >>> >
    >>> >> >>> >
    >>> >> >>> >
    >>> >> >>> > "Coen" <[email protected]> wrote in message news:[email protected]...
    >>> >> >>> >> Hi Ron, thanks for your quick response. Unfortunately I don't think this
    >>> >> >>> >> brings the solution. The menu I'm looking for is a context menu and only
    >>> >> >>> >> visible during 'copymode'. So if you have any idea's how to disable this
    >>> >> >>> >> "Insert Copied Cells" item, please.
    >>> >> >>> >>
    >>> >> >>> >> Again: my largest problem is how to disabe the context menu of "Insert
    >>> >> >>> >> Copied Cells".
    >>> >> >>> >>
    >>> >> >>> >> Regards Coen.
    >>> >> >>> >>
    >>> >> >>> >>
    >>> >> >>> >> "Ron de Bruin" wrote:
    >>> >> >>> >>
    >>> >> >>> >>> I see that I paste the wrong link
    >>> >> >>> >>> This is the good one
    >>> >> >>> >>> http://www.rondebruin.com/menuid.htm
    >>> >> >>> >>>
    >>> >> >>> >>> --
    >>> >> >>> >>> Regards Ron de Bruin
    >>> >> >>> >>> http://www.rondebruin.nl
    >>> >> >>> >>>
    >>> >> >>> >>>
    >>> >> >>> >>>
    >>> >> >>> >>> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >>> >> >>> >>> > Hi Coen
    >>> >> >>> >>> >
    >>> >> >>> >>> > See
    >>> >> >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    >>> >> >>> >>> >
    >>> >> >>> >>> >
    >>> >> >>> >>> > --
    >>> >> >>> >>> > Regards Ron de Bruin
    >>> >> >>> >>> > http://www.rondebruin.nl
    >>> >> >>> >>> >
    >>> >> >>> >>> >
    >>> >> >>> >>> >
    >>> >> >>> >>> > "Coen" <[email protected]> wrote in message
    >>> >> >>> >>> > news:[email protected]...
    >>> >> >>> >>> >> Hi,
    >>> >> >>> >>> >>
    >>> >> >>> >>> >> When one or more rows are in copy mode, the row(s) can be pasted by means of
    >>> >> >>> >>> >> the contextmenu item (right mouse button): Insert Copied Cells. I need to
    >>> >> >>> >>> >> disable especially this item and also the "Copied Cells" from the Insert
    >>> >> >>> >>> >> menu. Does any one know how to achieve this?
    >>> >> >>> >>> >>
    >>> >> >>> >>> >
    >>> >> >>> >>> >
    >>> >> >>> >>>
    >>> >> >>> >>>
    >>> >> >>> >>>
    >>> >> >>> >
    >>> >> >>> >
    >>> >> >>>
    >>> >> >>>
    >>> >> >>>
    >>> >> >
    >>> >> >
    >>> >>
    >>> >>
    >>> >>
    >>>
    >>>
    >>>

    >
    >




  15. #15
    Peter T
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Ron,

    This subject is of interest to me to prevent change in layout of cells. I
    can almost cater for inserted/deleted rows/columns but not inserted cells.

    The "Insert" ID's change according to:
    - State of CutCopyMode if cells in clipboard, and
    - Insert ID is only updated AFTER user has right clicked row/column header,
    Cell menu, or clicked main Insert menu.

    Row/Column
    3181 "&Insert..."
    3183 "&Insert"
    3187 "&Insert Copied Cells..."
    Main Insert Menu
    295 "C&ells"
    3184 "Copied C&ells..."
    Cell
    3181 "&Insert..."
    3185 "Insert Copied C&ells..."

    It's a real pain! Problem is only the current item can be changed at any one
    time. Trying all with "On Error Resume Next" doesn't help. Only alternative
    as far as I can see is to disable the entire respective menus, which I don't
    want to do. Unless of course you have any other ideas??

    Regards,
    Peter T

    "Ron de Bruin" <[email protected]> wrote in message
    news:[email protected]...
    > It is very strange
    >
    > The row and column "Insert" option use the same ID number
    > But sometimes it say 3181 and the other time 3183.
    >
    > I think there is a bug, I will see if I can find a save workaround
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Ron de Bruin" <[email protected]> wrote in message

    news:%[email protected]...
    > > Hi Coen
    > >
    > > I think the best thing that you can do is to disable "Insert"
    > > It will disable Inset copeid cells also.
    > >
    > > This seems to work fine, only the row ID for insert is 3181 but this is

    not working.
    > > I am searching the real number now.(I post back)
    > >
    > > Sub falsefalse()
    > > On Error Resume Next
    > > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > > (ID:=295, Recursive:=True).Enabled = False
    > >
    > > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = False
    > > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = False
    > > Application.CommandBars("Column").FindControl(ID:=3183).Enabled =

    False
    > > End Sub
    > >
    > > Sub truetrue()
    > > On Error Resume Next
    > > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > > (ID:=295, Recursive:=True).Enabled = True
    > >
    > > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = True
    > > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = True
    > > Application.CommandBars("Column").FindControl(ID:=3183).Enabled =

    True
    > > End Sub
    > >
    > >
    > > --
    > > Regards Ron de Bruin
    > > http://www.rondebruin.nl
    > >
    > >
    > >
    > > "Coen" <[email protected]> wrote in message

    news:[email protected]...
    > >> Hi Ron (and everyone having suggestions),
    > >>
    > >> Situation is as the following. I'm dealing with an add-in application

    (.xla
    > >> and Office 2003). At startup of this application (preferrably at the
    > >> Workbook_Open event) I should disable all three "Insert Copied Cells"
    > >> menuitems. This is not as easy as it looks for me because these items

    are not
    > >> available at startup, so any ideas are more then welcome.
    > >>
    > >>
    > >> "Ron de Bruin" wrote:
    > >>
    > >>> Hi Coen
    > >>>
    > >>> It seems that only the Insert menu item is a problem.
    > >>> I will test more tomorrow after work.
    > >>>
    > >>>
    > >>> --
    > >>> Regards Ron de Bruin
    > >>> http://www.rondebruin.nl
    > >>>
    > >>>
    > >>>
    > >>> "Coen" <[email protected]> wrote in message

    news:[email protected]...
    > >>> > Hi Ron, would be great! I'll check for answers this evening.
    > >>> > Thanks anyway.
    > >>> >
    > >>> > "Ron de Bruin" wrote:
    > >>> >
    > >>> >> Hi Coen
    > >>> >>
    > >>> >> I see it now also
    > >>> >>
    > >>> >> I will see if I have time tomorrow to find a solution
    > >>> >>
    > >>> >>
    > >>> >> --
    > >>> >> Regards Ron de Bruin
    > >>> >> http://www.rondebruin.nl
    > >>> >>
    > >>> >>
    > >>> >>
    > >>> >> "Ron de Bruin" <[email protected]> wrote in message

    news:[email protected]...
    > >>> >> >> looks like they are not always available
    > >>> >> > That's correct
    > >>> >> >
    > >>> >> > If there is something on the Clipboard they are available
    > >>> >> > But it is working for me with the test macro
    > >>> >> >
    > >>> >> > I will test more tomorrow(bed time for me now)
    > >>> >> >
    > >>> >> >
    > >>> >> >
    > >>> >> > --
    > >>> >> > Regards Ron de Bruin
    > >>> >> > http://www.rondebruin.nl
    > >>> >> >
    > >>> >> >
    > >>> >> >
    > >>> >> > "Coen" <[email protected]> wrote in message

    news:[email protected]...
    > >>> >> >> Thanks Ron, you helped me a lot.
    > >>> >> >> The only issue yet left is:
    > >>> >> >>
    > >>> >> >> This item is in:
    > >>> >> >> CommandBar: Cell ID = 3185
    > >>> >> >> CommandBar: Row ID = 3187
    > >>> >> >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    > >>> >> >>
    > >>> >> >> At opening a spec. Excel-book I need to disable ALL this three

    items. But it
    > >>> >> >> looks like they are not always available. It looks like you have

    to be in a
    > >>> >> >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to

    disable the
    > >>> >> >> items.
    > >>> >> >>
    > >>> >> >> Any ideas about this?
    > >>> >> >>
    > >>> >> >> Coen
    > >>> >> >>
    > >>> >> >>
    > >>> >> >>
    > >>> >> >>
    > >>> >> >> "Ron de Bruin" wrote:
    > >>> >> >>
    > >>> >> >>> Ok
    > >>> >> >>>
    > >>> >> >>> Here is a example
    > >>> >> >>>
    > >>> >> >>> Sub TEST()
    > >>> >> >>> On Error Resume Next
    > >>> >> >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    > >>> >> >>> (ID:=3184, Recursive:=True).Enabled = False
    > >>> >> >>>
    > >>> >> >>>

    Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    > >>> >> >>>
    > >>> >> >>> End Sub
    > >>> >> >>>
    > >>> >> >>>
    > >>> >> >>> --
    > >>> >> >>> Regards Ron de Bruin
    > >>> >> >>> http://www.rondebruin.nl
    > >>> >> >>>
    > >>> >> >>>
    > >>> >> >>>
    > >>> >> >>> "Ron de Bruin" <[email protected]> wrote in message

    news:[email protected]...
    > >>> >> >>> > Hi Coen
    > >>> >> >>> >
    > >>> >> >>> > You can find the ID numbers for this.(links on the bottom of

    the page)
    > >>> >> >>> > I will look them up for you this evening.
    > >>> >> >>> >
    > >>> >> >>> > But first I put the kids in bed.
    > >>> >> >>> >
    > >>> >> >>> >
    > >>> >> >>> > --
    > >>> >> >>> > Regards Ron de Bruin
    > >>> >> >>> > http://www.rondebruin.nl
    > >>> >> >>> >
    > >>> >> >>> >
    > >>> >> >>> >
    > >>> >> >>> > "Coen" <[email protected]> wrote in message

    news:[email protected]...
    > >>> >> >>> >> Hi Ron, thanks for your quick response. Unfortunately I

    don't think this
    > >>> >> >>> >> brings the solution. The menu I'm looking for is a context

    menu and only
    > >>> >> >>> >> visible during 'copymode'. So if you have any idea's how to

    disable this
    > >>> >> >>> >> "Insert Copied Cells" item, please.
    > >>> >> >>> >>
    > >>> >> >>> >> Again: my largest problem is how to disabe the context menu

    of "Insert
    > >>> >> >>> >> Copied Cells".
    > >>> >> >>> >>
    > >>> >> >>> >> Regards Coen.
    > >>> >> >>> >>
    > >>> >> >>> >>
    > >>> >> >>> >> "Ron de Bruin" wrote:
    > >>> >> >>> >>
    > >>> >> >>> >>> I see that I paste the wrong link
    > >>> >> >>> >>> This is the good one
    > >>> >> >>> >>> http://www.rondebruin.com/menuid.htm
    > >>> >> >>> >>>
    > >>> >> >>> >>> --
    > >>> >> >>> >>> Regards Ron de Bruin
    > >>> >> >>> >>> http://www.rondebruin.nl
    > >>> >> >>> >>>
    > >>> >> >>> >>>
    > >>> >> >>> >>>
    > >>> >> >>> >>> "Ron de Bruin" <[email protected]> wrote in message

    news:[email protected]...
    > >>> >> >>> >>> > Hi Coen
    > >>> >> >>> >>> >
    > >>> >> >>> >>> > See
    > >>> >> >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    > >>> >> >>> >>> >
    > >>> >> >>> >>> >
    > >>> >> >>> >>> > --
    > >>> >> >>> >>> > Regards Ron de Bruin
    > >>> >> >>> >>> > http://www.rondebruin.nl
    > >>> >> >>> >>> >
    > >>> >> >>> >>> >
    > >>> >> >>> >>> >
    > >>> >> >>> >>> > "Coen" <[email protected]> wrote in

    message
    > >>> >> >>> >>> >

    news:[email protected]...
    > >>> >> >>> >>> >> Hi,
    > >>> >> >>> >>> >>
    > >>> >> >>> >>> >> When one or more rows are in copy mode, the row(s) can

    be pasted by means of
    > >>> >> >>> >>> >> the contextmenu item (right mouse button): Insert Copied

    Cells. I need to
    > >>> >> >>> >>> >> disable especially this item and also the "Copied Cells"

    from the Insert
    > >>> >> >>> >>> >> menu. Does any one know how to achieve this?
    > >>> >> >>> >>> >>
    > >>> >> >>> >>> >
    > >>> >> >>> >>> >
    > >>> >> >>> >>>
    > >>> >> >>> >>>
    > >>> >> >>> >>>
    > >>> >> >>> >
    > >>> >> >>> >
    > >>> >> >>>
    > >>> >> >>>
    > >>> >> >>>
    > >>> >> >
    > >>> >> >
    > >>> >>
    > >>> >>
    > >>> >>
    > >>>
    > >>>
    > >>>

    > >
    > >

    >
    >




  16. #16
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Peter

    I will look for a solution when I have time.
    If I find something I will post back.



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Peter T" <peter_t@discussions> wrote in message news:[email protected]...
    > Hi Ron,
    >
    > This subject is of interest to me to prevent change in layout of cells. I
    > can almost cater for inserted/deleted rows/columns but not inserted cells.
    >
    > The "Insert" ID's change according to:
    > - State of CutCopyMode if cells in clipboard, and
    > - Insert ID is only updated AFTER user has right clicked row/column header,
    > Cell menu, or clicked main Insert menu.
    >
    > Row/Column
    > 3181 "&Insert..."
    > 3183 "&Insert"
    > 3187 "&Insert Copied Cells..."
    > Main Insert Menu
    > 295 "C&ells"
    > 3184 "Copied C&ells..."
    > Cell
    > 3181 "&Insert..."
    > 3185 "Insert Copied C&ells..."
    >
    > It's a real pain! Problem is only the current item can be changed at any one
    > time. Trying all with "On Error Resume Next" doesn't help. Only alternative
    > as far as I can see is to disable the entire respective menus, which I don't
    > want to do. Unless of course you have any other ideas??
    >
    > Regards,
    > Peter T
    >
    > "Ron de Bruin" <[email protected]> wrote in message
    > news:[email protected]...
    >> It is very strange
    >>
    >> The row and column "Insert" option use the same ID number
    >> But sometimes it say 3181 and the other time 3183.
    >>
    >> I think there is a bug, I will see if I can find a save workaround
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >>
    >> "Ron de Bruin" <[email protected]> wrote in message

    > news:%[email protected]...
    >> > Hi Coen
    >> >
    >> > I think the best thing that you can do is to disable "Insert"
    >> > It will disable Inset copeid cells also.
    >> >
    >> > This seems to work fine, only the row ID for insert is 3181 but this is

    > not working.
    >> > I am searching the real number now.(I post back)
    >> >
    >> > Sub falsefalse()
    >> > On Error Resume Next
    >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    >> > (ID:=295, Recursive:=True).Enabled = False
    >> >
    >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = False
    >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = False
    >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled =

    > False
    >> > End Sub
    >> >
    >> > Sub truetrue()
    >> > On Error Resume Next
    >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    >> > (ID:=295, Recursive:=True).Enabled = True
    >> >
    >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = True
    >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = True
    >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled =

    > True
    >> > End Sub
    >> >
    >> >
    >> > --
    >> > Regards Ron de Bruin
    >> > http://www.rondebruin.nl
    >> >
    >> >
    >> >
    >> > "Coen" <[email protected]> wrote in message

    > news:[email protected]...
    >> >> Hi Ron (and everyone having suggestions),
    >> >>
    >> >> Situation is as the following. I'm dealing with an add-in application

    > (.xla
    >> >> and Office 2003). At startup of this application (preferrably at the
    >> >> Workbook_Open event) I should disable all three "Insert Copied Cells"
    >> >> menuitems. This is not as easy as it looks for me because these items

    > are not
    >> >> available at startup, so any ideas are more then welcome.
    >> >>
    >> >>
    >> >> "Ron de Bruin" wrote:
    >> >>
    >> >>> Hi Coen
    >> >>>
    >> >>> It seems that only the Insert menu item is a problem.
    >> >>> I will test more tomorrow after work.
    >> >>>
    >> >>>
    >> >>> --
    >> >>> Regards Ron de Bruin
    >> >>> http://www.rondebruin.nl
    >> >>>
    >> >>>
    >> >>>
    >> >>> "Coen" <[email protected]> wrote in message

    > news:[email protected]...
    >> >>> > Hi Ron, would be great! I'll check for answers this evening.
    >> >>> > Thanks anyway.
    >> >>> >
    >> >>> > "Ron de Bruin" wrote:
    >> >>> >
    >> >>> >> Hi Coen
    >> >>> >>
    >> >>> >> I see it now also
    >> >>> >>
    >> >>> >> I will see if I have time tomorrow to find a solution
    >> >>> >>
    >> >>> >>
    >> >>> >> --
    >> >>> >> Regards Ron de Bruin
    >> >>> >> http://www.rondebruin.nl
    >> >>> >>
    >> >>> >>
    >> >>> >>
    >> >>> >> "Ron de Bruin" <[email protected]> wrote in message

    > news:[email protected]...
    >> >>> >> >> looks like they are not always available
    >> >>> >> > That's correct
    >> >>> >> >
    >> >>> >> > If there is something on the Clipboard they are available
    >> >>> >> > But it is working for me with the test macro
    >> >>> >> >
    >> >>> >> > I will test more tomorrow(bed time for me now)
    >> >>> >> >
    >> >>> >> >
    >> >>> >> >
    >> >>> >> > --
    >> >>> >> > Regards Ron de Bruin
    >> >>> >> > http://www.rondebruin.nl
    >> >>> >> >
    >> >>> >> >
    >> >>> >> >
    >> >>> >> > "Coen" <[email protected]> wrote in message

    > news:[email protected]...
    >> >>> >> >> Thanks Ron, you helped me a lot.
    >> >>> >> >> The only issue yet left is:
    >> >>> >> >>
    >> >>> >> >> This item is in:
    >> >>> >> >> CommandBar: Cell ID = 3185
    >> >>> >> >> CommandBar: Row ID = 3187
    >> >>> >> >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    >> >>> >> >>
    >> >>> >> >> At opening a spec. Excel-book I need to disable ALL this three

    > items. But it
    >> >>> >> >> looks like they are not always available. It looks like you have

    > to be in a
    >> >>> >> >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to

    > disable the
    >> >>> >> >> items.
    >> >>> >> >>
    >> >>> >> >> Any ideas about this?
    >> >>> >> >>
    >> >>> >> >> Coen
    >> >>> >> >>
    >> >>> >> >>
    >> >>> >> >>
    >> >>> >> >>
    >> >>> >> >> "Ron de Bruin" wrote:
    >> >>> >> >>
    >> >>> >> >>> Ok
    >> >>> >> >>>
    >> >>> >> >>> Here is a example
    >> >>> >> >>>
    >> >>> >> >>> Sub TEST()
    >> >>> >> >>> On Error Resume Next
    >> >>> >> >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    >> >>> >> >>> (ID:=3184, Recursive:=True).Enabled = False
    >> >>> >> >>>
    >> >>> >> >>>

    > Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    >> >>> >> >>>
    >> >>> >> >>> End Sub
    >> >>> >> >>>
    >> >>> >> >>>
    >> >>> >> >>> --
    >> >>> >> >>> Regards Ron de Bruin
    >> >>> >> >>> http://www.rondebruin.nl
    >> >>> >> >>>
    >> >>> >> >>>
    >> >>> >> >>>
    >> >>> >> >>> "Ron de Bruin" <[email protected]> wrote in message

    > news:[email protected]...
    >> >>> >> >>> > Hi Coen
    >> >>> >> >>> >
    >> >>> >> >>> > You can find the ID numbers for this.(links on the bottom of

    > the page)
    >> >>> >> >>> > I will look them up for you this evening.
    >> >>> >> >>> >
    >> >>> >> >>> > But first I put the kids in bed.
    >> >>> >> >>> >
    >> >>> >> >>> >
    >> >>> >> >>> > --
    >> >>> >> >>> > Regards Ron de Bruin
    >> >>> >> >>> > http://www.rondebruin.nl
    >> >>> >> >>> >
    >> >>> >> >>> >
    >> >>> >> >>> >
    >> >>> >> >>> > "Coen" <[email protected]> wrote in message

    > news:[email protected]...
    >> >>> >> >>> >> Hi Ron, thanks for your quick response. Unfortunately I

    > don't think this
    >> >>> >> >>> >> brings the solution. The menu I'm looking for is a context

    > menu and only
    >> >>> >> >>> >> visible during 'copymode'. So if you have any idea's how to

    > disable this
    >> >>> >> >>> >> "Insert Copied Cells" item, please.
    >> >>> >> >>> >>
    >> >>> >> >>> >> Again: my largest problem is how to disabe the context menu

    > of "Insert
    >> >>> >> >>> >> Copied Cells".
    >> >>> >> >>> >>
    >> >>> >> >>> >> Regards Coen.
    >> >>> >> >>> >>
    >> >>> >> >>> >>
    >> >>> >> >>> >> "Ron de Bruin" wrote:
    >> >>> >> >>> >>
    >> >>> >> >>> >>> I see that I paste the wrong link
    >> >>> >> >>> >>> This is the good one
    >> >>> >> >>> >>> http://www.rondebruin.com/menuid.htm
    >> >>> >> >>> >>>
    >> >>> >> >>> >>> --
    >> >>> >> >>> >>> Regards Ron de Bruin
    >> >>> >> >>> >>> http://www.rondebruin.nl
    >> >>> >> >>> >>>
    >> >>> >> >>> >>>
    >> >>> >> >>> >>>
    >> >>> >> >>> >>> "Ron de Bruin" <[email protected]> wrote in message

    > news:[email protected]...
    >> >>> >> >>> >>> > Hi Coen
    >> >>> >> >>> >>> >
    >> >>> >> >>> >>> > See
    >> >>> >> >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    >> >>> >> >>> >>> >
    >> >>> >> >>> >>> >
    >> >>> >> >>> >>> > --
    >> >>> >> >>> >>> > Regards Ron de Bruin
    >> >>> >> >>> >>> > http://www.rondebruin.nl
    >> >>> >> >>> >>> >
    >> >>> >> >>> >>> >
    >> >>> >> >>> >>> >
    >> >>> >> >>> >>> > "Coen" <[email protected]> wrote in

    > message
    >> >>> >> >>> >>> >

    > news:[email protected]...
    >> >>> >> >>> >>> >> Hi,
    >> >>> >> >>> >>> >>
    >> >>> >> >>> >>> >> When one or more rows are in copy mode, the row(s) can

    > be pasted by means of
    >> >>> >> >>> >>> >> the contextmenu item (right mouse button): Insert Copied

    > Cells. I need to
    >> >>> >> >>> >>> >> disable especially this item and also the "Copied Cells"

    > from the Insert
    >> >>> >> >>> >>> >> menu. Does any one know how to achieve this?
    >> >>> >> >>> >>> >>
    >> >>> >> >>> >>> >
    >> >>> >> >>> >>> >
    >> >>> >> >>> >>>
    >> >>> >> >>> >>>
    >> >>> >> >>> >>>
    >> >>> >> >>> >
    >> >>> >> >>> >
    >> >>> >> >>>
    >> >>> >> >>>
    >> >>> >> >>>
    >> >>> >> >
    >> >>> >> >
    >> >>> >>
    >> >>> >>
    >> >>> >>
    >> >>>
    >> >>>
    >> >>>
    >> >
    >> >

    >>
    >>

    >
    >




  17. #17
    Coen
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi guys,

    I'm almost completely lost! I only want to disable (or remove, or change the
    action etc) the "Insert Copied Cells" from the row and cell menus. It looks
    this can only be done (for the rowmenu) when the sheet is in "row" copymode
    and the right mouse menu is visible. And this causes an unwanted sideeffect:
    when the "Insert Copied Cells" item has been disabled (or deleted etc), the
    same effect is there for the "Insert" item (i.e. insert a row) when the sheet
    is not anymore in row-copymode. That's not what I want, the Insert item must
    be kept enabled.
    Is this really not possible?



    But this effects also the

    "Ron de Bruin" wrote:

    > Hi Peter
    >
    > I will look for a solution when I have time.
    > If I find something I will post back.
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Peter T" <peter_t@discussions> wrote in message news:[email protected]...
    > > Hi Ron,
    > >
    > > This subject is of interest to me to prevent change in layout of cells. I
    > > can almost cater for inserted/deleted rows/columns but not inserted cells.
    > >
    > > The "Insert" ID's change according to:
    > > - State of CutCopyMode if cells in clipboard, and
    > > - Insert ID is only updated AFTER user has right clicked row/column header,
    > > Cell menu, or clicked main Insert menu.
    > >
    > > Row/Column
    > > 3181 "&Insert..."
    > > 3183 "&Insert"
    > > 3187 "&Insert Copied Cells..."
    > > Main Insert Menu
    > > 295 "C&ells"
    > > 3184 "Copied C&ells..."
    > > Cell
    > > 3181 "&Insert..."
    > > 3185 "Insert Copied C&ells..."
    > >
    > > It's a real pain! Problem is only the current item can be changed at any one
    > > time. Trying all with "On Error Resume Next" doesn't help. Only alternative
    > > as far as I can see is to disable the entire respective menus, which I don't
    > > want to do. Unless of course you have any other ideas??
    > >
    > > Regards,
    > > Peter T
    > >
    > > "Ron de Bruin" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> It is very strange
    > >>
    > >> The row and column "Insert" option use the same ID number
    > >> But sometimes it say 3181 and the other time 3183.
    > >>
    > >> I think there is a bug, I will see if I can find a save workaround
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >>
    > >> "Ron de Bruin" <[email protected]> wrote in message

    > > news:%[email protected]...
    > >> > Hi Coen
    > >> >
    > >> > I think the best thing that you can do is to disable "Insert"
    > >> > It will disable Inset copeid cells also.
    > >> >
    > >> > This seems to work fine, only the row ID for insert is 3181 but this is

    > > not working.
    > >> > I am searching the real number now.(I post back)
    > >> >
    > >> > Sub falsefalse()
    > >> > On Error Resume Next
    > >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > >> > (ID:=295, Recursive:=True).Enabled = False
    > >> >
    > >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = False
    > >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = False
    > >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled =

    > > False
    > >> > End Sub
    > >> >
    > >> > Sub truetrue()
    > >> > On Error Resume Next
    > >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > >> > (ID:=295, Recursive:=True).Enabled = True
    > >> >
    > >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled = True
    > >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled = True
    > >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled =

    > > True
    > >> > End Sub
    > >> >
    > >> >
    > >> > --
    > >> > Regards Ron de Bruin
    > >> > http://www.rondebruin.nl
    > >> >
    > >> >
    > >> >
    > >> > "Coen" <[email protected]> wrote in message

    > > news:[email protected]...
    > >> >> Hi Ron (and everyone having suggestions),
    > >> >>
    > >> >> Situation is as the following. I'm dealing with an add-in application

    > > (.xla
    > >> >> and Office 2003). At startup of this application (preferrably at the
    > >> >> Workbook_Open event) I should disable all three "Insert Copied Cells"
    > >> >> menuitems. This is not as easy as it looks for me because these items

    > > are not
    > >> >> available at startup, so any ideas are more then welcome.
    > >> >>
    > >> >>
    > >> >> "Ron de Bruin" wrote:
    > >> >>
    > >> >>> Hi Coen
    > >> >>>
    > >> >>> It seems that only the Insert menu item is a problem.
    > >> >>> I will test more tomorrow after work.
    > >> >>>
    > >> >>>
    > >> >>> --
    > >> >>> Regards Ron de Bruin
    > >> >>> http://www.rondebruin.nl
    > >> >>>
    > >> >>>
    > >> >>>
    > >> >>> "Coen" <[email protected]> wrote in message

    > > news:[email protected]...
    > >> >>> > Hi Ron, would be great! I'll check for answers this evening.
    > >> >>> > Thanks anyway.
    > >> >>> >
    > >> >>> > "Ron de Bruin" wrote:
    > >> >>> >
    > >> >>> >> Hi Coen
    > >> >>> >>
    > >> >>> >> I see it now also
    > >> >>> >>
    > >> >>> >> I will see if I have time tomorrow to find a solution
    > >> >>> >>
    > >> >>> >>
    > >> >>> >> --
    > >> >>> >> Regards Ron de Bruin
    > >> >>> >> http://www.rondebruin.nl
    > >> >>> >>
    > >> >>> >>
    > >> >>> >>
    > >> >>> >> "Ron de Bruin" <[email protected]> wrote in message

    > > news:[email protected]...
    > >> >>> >> >> looks like they are not always available
    > >> >>> >> > That's correct
    > >> >>> >> >
    > >> >>> >> > If there is something on the Clipboard they are available
    > >> >>> >> > But it is working for me with the test macro
    > >> >>> >> >
    > >> >>> >> > I will test more tomorrow(bed time for me now)
    > >> >>> >> >
    > >> >>> >> >
    > >> >>> >> >
    > >> >>> >> > --
    > >> >>> >> > Regards Ron de Bruin
    > >> >>> >> > http://www.rondebruin.nl
    > >> >>> >> >
    > >> >>> >> >
    > >> >>> >> >
    > >> >>> >> > "Coen" <[email protected]> wrote in message

    > > news:[email protected]...
    > >> >>> >> >> Thanks Ron, you helped me a lot.
    > >> >>> >> >> The only issue yet left is:
    > >> >>> >> >>
    > >> >>> >> >> This item is in:
    > >> >>> >> >> CommandBar: Cell ID = 3185
    > >> >>> >> >> CommandBar: Row ID = 3187
    > >> >>> >> >> CommandBar: Worksheet Menu Bar(recursive) ID = 3184
    > >> >>> >> >>
    > >> >>> >> >> At opening a spec. Excel-book I need to disable ALL this three

    > > items. But it
    > >> >>> >> >> looks like they are not always available. It looks like you have

    > > to be in a
    > >> >>> >> >> sort of 'Cell copy mode' or in 'Row copy mode' to be able to

    > > disable the
    > >> >>> >> >> items.
    > >> >>> >> >>
    > >> >>> >> >> Any ideas about this?
    > >> >>> >> >>
    > >> >>> >> >> Coen
    > >> >>> >> >>
    > >> >>> >> >>
    > >> >>> >> >>
    > >> >>> >> >>
    > >> >>> >> >> "Ron de Bruin" wrote:
    > >> >>> >> >>
    > >> >>> >> >>> Ok
    > >> >>> >> >>>
    > >> >>> >> >>> Here is a example
    > >> >>> >> >>>
    > >> >>> >> >>> Sub TEST()
    > >> >>> >> >>> On Error Resume Next
    > >> >>> >> >>> Application.CommandBars("Worksheet Menu Bar").FindControl _
    > >> >>> >> >>> (ID:=3184, Recursive:=True).Enabled = False
    > >> >>> >> >>>
    > >> >>> >> >>>

    > > Application.CommandBars("Cell").FindControl(ID:=3185).Enabled = False
    > >> >>> >> >>>
    > >> >>> >> >>> End Sub
    > >> >>> >> >>>
    > >> >>> >> >>>
    > >> >>> >> >>> --
    > >> >>> >> >>> Regards Ron de Bruin
    > >> >>> >> >>> http://www.rondebruin.nl
    > >> >>> >> >>>
    > >> >>> >> >>>
    > >> >>> >> >>>
    > >> >>> >> >>> "Ron de Bruin" <[email protected]> wrote in message

    > > news:[email protected]...
    > >> >>> >> >>> > Hi Coen
    > >> >>> >> >>> >
    > >> >>> >> >>> > You can find the ID numbers for this.(links on the bottom of

    > > the page)
    > >> >>> >> >>> > I will look them up for you this evening.
    > >> >>> >> >>> >
    > >> >>> >> >>> > But first I put the kids in bed.
    > >> >>> >> >>> >
    > >> >>> >> >>> >
    > >> >>> >> >>> > --
    > >> >>> >> >>> > Regards Ron de Bruin
    > >> >>> >> >>> > http://www.rondebruin.nl
    > >> >>> >> >>> >
    > >> >>> >> >>> >
    > >> >>> >> >>> >
    > >> >>> >> >>> > "Coen" <[email protected]> wrote in message

    > > news:[email protected]...
    > >> >>> >> >>> >> Hi Ron, thanks for your quick response. Unfortunately I

    > > don't think this
    > >> >>> >> >>> >> brings the solution. The menu I'm looking for is a context

    > > menu and only
    > >> >>> >> >>> >> visible during 'copymode'. So if you have any idea's how to

    > > disable this
    > >> >>> >> >>> >> "Insert Copied Cells" item, please.
    > >> >>> >> >>> >>
    > >> >>> >> >>> >> Again: my largest problem is how to disabe the context menu

    > > of "Insert
    > >> >>> >> >>> >> Copied Cells".
    > >> >>> >> >>> >>
    > >> >>> >> >>> >> Regards Coen.
    > >> >>> >> >>> >>
    > >> >>> >> >>> >>
    > >> >>> >> >>> >> "Ron de Bruin" wrote:
    > >> >>> >> >>> >>
    > >> >>> >> >>> >>> I see that I paste the wrong link
    > >> >>> >> >>> >>> This is the good one
    > >> >>> >> >>> >>> http://www.rondebruin.com/menuid.htm
    > >> >>> >> >>> >>>
    > >> >>> >> >>> >>> --
    > >> >>> >> >>> >>> Regards Ron de Bruin
    > >> >>> >> >>> >>> http://www.rondebruin.nl
    > >> >>> >> >>> >>>
    > >> >>> >> >>> >>>
    > >> >>> >> >>> >>>
    > >> >>> >> >>> >>> "Ron de Bruin" <[email protected]> wrote in message

    > > news:[email protected]...
    > >> >>> >> >>> >>> > Hi Coen
    > >> >>> >> >>> >>> >
    > >> >>> >> >>> >>> > See
    > >> >>> >> >>> >>> > http://www.rondebruin.nl/weeknumber.htm
    > >> >>> >> >>> >>> >
    > >> >>> >> >>> >>> >
    > >> >>> >> >>> >>> > --
    > >> >>> >> >>> >>> > Regards Ron de Bruin
    > >> >>> >> >>> >>> > http://www.rondebruin.nl
    > >> >>> >> >>> >>> >
    > >> >>> >> >>> >>> >
    > >> >>> >> >>> >>> >
    > >> >>> >> >>> >>> > "Coen" <[email protected]> wrote in

    > > message
    > >> >>> >> >>> >>> >

    > > news:[email protected]...
    > >> >>> >> >>> >>> >> Hi,
    > >> >>> >> >>> >>> >>
    > >> >>> >> >>> >>> >> When one or more rows are in copy mode, the row(s) can

    > > be pasted by means of
    > >> >>> >> >>> >>> >> the contextmenu item (right mouse button): Insert Copied

    > > Cells. I need to
    > >> >>> >> >>> >>> >> disable especially this item and also the "Copied Cells"

    > > from the Insert
    > >> >>> >> >>> >>> >> menu. Does any one know how to achieve this?
    > >> >>> >> >>> >>> >>
    > >> >>> >> >>> >>> >
    > >> >>> >> >>> >>> >
    > >> >>> >> >>> >>>
    > >> >>> >> >>> >>>
    > >> >>> >> >>> >>>
    > >> >>> >> >>> >
    > >> >>> >> >>> >
    > >> >>> >> >>>
    > >> >>> >> >>>
    > >> >>> >> >>>
    > >> >>> >> >
    > >> >>> >> >
    > >> >>> >>
    > >> >>> >>
    > >> >>> >>
    > >> >>>
    > >> >>>
    > >> >>>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
    >


  18. #18
    Peter T
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Ron - my comment "Trying all with On Error Resume Next doesn't help" was
    wrong, see modified version of your routine below.

    Coen - I don't see any way to selectively disable "Insert Copied Cells" from
    Row, Column & Cell menus, and "Copied Cells" from main Insert menu, and not
    disable the other related menus. But Ron might !

    If you are in a position always to know the state "CutCopyMode" following
    should be OK for you, use the "copy mode" version in the Test sub. But I
    imagine that's unlikely.

    Curiosity - what's the purpose to disable only "Insert Copied Cells" whilst
    allowing "Paste" and "Insert".

    Sub Test()
    'toggle menus
    Static bln As Boolean
    bln = Not bln
    EnableInsertMenus bln

    'or according to copy mode
    'EnableInsertMenus Not CBool(Application.CutCopyMode)
    End Sub

    Sub EnableInsertMenus(bEnable As Boolean)
    'don't forget to run this with True when done
    Dim cb As CommandBar, oCtl As Object
    Dim va, i As Long, j As Long, nID As Long

    'Debug.Print
    'Debug.Print "CutCopyMode: " & CBool(Application.CutCopyMode)
    'Debug.Print "Menus Enabled: " & bEnable

    va = Array("Insert", "Cell", "Row", "Column")
    On Error Resume Next
    For i = LBound(va) To UBound(va)
    Set cb = Application.CommandBars(va(i))

    For j = 3181 To 3187
    If j = 3186 Then
    nID = 295
    Else: nID = j
    End If

    Set oCtl = cb.FindControl(ID:=nID)
    oCtl.Enabled = bEnable

    ' If Err.Number Then
    ' Err.Clear
    ' Else
    ' Debug.Print va(i), oCtl.ID, oCtl.Caption
    ' End If
    Next
    Next

    End Sub

    I stumbled across ID 3182 "C&ells" in the main Insert menu. Seems ID's 3181
    to 3185, 3187 need processing. I've not seen 3186, hence substituted with
    295 in the routine, but maybe 3186 should also be included.

    Don't think above should cause permanent loss of "inserts", but if necessary
    include "cb.Reset" below "Set cb" and comment everything below except the
    last Next.

    Regards,
    Peter T

    "Coen" <[email protected]> wrote in message
    news:[email protected]...
    > Hi guys,
    >
    > I'm almost completely lost! I only want to disable (or remove, or change

    the
    > action etc) the "Insert Copied Cells" from the row and cell menus. It

    looks
    > this can only be done (for the rowmenu) when the sheet is in "row"

    copymode
    > and the right mouse menu is visible. And this causes an unwanted

    sideeffect:
    > when the "Insert Copied Cells" item has been disabled (or deleted etc),

    the
    > same effect is there for the "Insert" item (i.e. insert a row) when the

    sheet
    > is not anymore in row-copymode. That's not what I want, the Insert item

    must
    > be kept enabled.
    > Is this really not possible?
    >
    >
    >
    > But this effects also the
    >
    > "Ron de Bruin" wrote:
    >
    > > Hi Peter
    > >
    > > I will look for a solution when I have time.
    > > If I find something I will post back.
    > >
    > >
    > >
    > > --
    > > Regards Ron de Bruin
    > > http://www.rondebruin.nl
    > >
    > >
    > >
    > > "Peter T" <peter_t@discussions> wrote in message

    news:[email protected]...
    > > > Hi Ron,
    > > >
    > > > This subject is of interest to me to prevent change in layout of

    cells. I
    > > > can almost cater for inserted/deleted rows/columns but not inserted

    cells.
    > > >
    > > > The "Insert" ID's change according to:
    > > > - State of CutCopyMode if cells in clipboard, and
    > > > - Insert ID is only updated AFTER user has right clicked row/column

    header,
    > > > Cell menu, or clicked main Insert menu.
    > > >
    > > > Row/Column
    > > > 3181 "&Insert..."
    > > > 3183 "&Insert"
    > > > 3187 "&Insert Copied Cells..."
    > > > Main Insert Menu
    > > > 295 "C&ells"
    > > > 3184 "Copied C&ells..."
    > > > Cell
    > > > 3181 "&Insert..."
    > > > 3185 "Insert Copied C&ells..."
    > > >
    > > > It's a real pain! Problem is only the current item can be changed at

    any one
    > > > time. Trying all with "On Error Resume Next" doesn't help. Only

    alternative
    > > > as far as I can see is to disable the entire respective menus, which I

    don't
    > > > want to do. Unless of course you have any other ideas??
    > > >
    > > > Regards,
    > > > Peter T
    > > >
    > > > "Ron de Bruin" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > >> It is very strange
    > > >>
    > > >> The row and column "Insert" option use the same ID number
    > > >> But sometimes it say 3181 and the other time 3183.
    > > >>
    > > >> I think there is a bug, I will see if I can find a save workaround
    > > >>
    > > >>
    > > >> --
    > > >> Regards Ron de Bruin
    > > >> http://www.rondebruin.nl
    > > >>
    > > >>
    > > >>
    > > >> "Ron de Bruin" <[email protected]> wrote in message
    > > > news:%[email protected]...
    > > >> > Hi Coen
    > > >> >
    > > >> > I think the best thing that you can do is to disable "Insert"
    > > >> > It will disable Inset copeid cells also.
    > > >> >
    > > >> > This seems to work fine, only the row ID for insert is 3181 but

    this is
    > > > not working.
    > > >> > I am searching the real number now.(I post back)
    > > >> >
    > > >> > Sub falsefalse()
    > > >> > On Error Resume Next
    > > >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > > >> > (ID:=295, Recursive:=True).Enabled = False
    > > >> >
    > > >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled =

    False
    > > >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled =

    False
    > > >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled

    =
    > > > False
    > > >> > End Sub
    > > >> >
    > > >> > Sub truetrue()
    > > >> > On Error Resume Next
    > > >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > > >> > (ID:=295, Recursive:=True).Enabled = True
    > > >> >
    > > >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled =

    True
    > > >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled =

    True
    > > >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled

    =
    > > > True
    > > >> > End Sub
    > > >> >
    > > >> >
    > > >> > --
    > > >> > Regards Ron de Bruin
    > > >> > http://www.rondebruin.nl

    >snip<




  19. #19
    Coen
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi peter, the reason for disabling only the "Insert Copied Cells" item is
    that I'm dealing with an vba application (xla) that was build in Excel 97.
    Now, after upgrading office to 2003, the Excel 2003 version appears to have a
    nasty problem which only occur while using this "Insert Copied Cells" option.
    This problem doesn't exist in the '97 version, where "insert copied cells"
    worked fine. In 2003 using a) copy a row, b) insert a blanc row, and c)
    paste the row is not causing this problem.

    Btw: your right, knowing the CutCopyMode status doesn't help me.

    Regards, Coen.

    "Peter T" wrote:

    > Ron - my comment "Trying all with On Error Resume Next doesn't help" was
    > wrong, see modified version of your routine below.
    >
    > Coen - I don't see any way to selectively disable "Insert Copied Cells" from
    > Row, Column & Cell menus, and "Copied Cells" from main Insert menu, and not
    > disable the other related menus. But Ron might !
    >
    > If you are in a position always to know the state "CutCopyMode" following
    > should be OK for you, use the "copy mode" version in the Test sub. But I
    > imagine that's unlikely.
    >
    > Curiosity - what's the purpose to disable only "Insert Copied Cells" whilst
    > allowing "Paste" and "Insert".
    >
    > Sub Test()
    > 'toggle menus
    > Static bln As Boolean
    > bln = Not bln
    > EnableInsertMenus bln
    >
    > 'or according to copy mode
    > 'EnableInsertMenus Not CBool(Application.CutCopyMode)
    > End Sub
    >
    > Sub EnableInsertMenus(bEnable As Boolean)
    > 'don't forget to run this with True when done
    > Dim cb As CommandBar, oCtl As Object
    > Dim va, i As Long, j As Long, nID As Long
    >
    > 'Debug.Print
    > 'Debug.Print "CutCopyMode: " & CBool(Application.CutCopyMode)
    > 'Debug.Print "Menus Enabled: " & bEnable
    >
    > va = Array("Insert", "Cell", "Row", "Column")
    > On Error Resume Next
    > For i = LBound(va) To UBound(va)
    > Set cb = Application.CommandBars(va(i))
    >
    > For j = 3181 To 3187
    > If j = 3186 Then
    > nID = 295
    > Else: nID = j
    > End If
    >
    > Set oCtl = cb.FindControl(ID:=nID)
    > oCtl.Enabled = bEnable
    >
    > ' If Err.Number Then
    > ' Err.Clear
    > ' Else
    > ' Debug.Print va(i), oCtl.ID, oCtl.Caption
    > ' End If
    > Next
    > Next
    >
    > End Sub
    >
    > I stumbled across ID 3182 "C&ells" in the main Insert menu. Seems ID's 3181
    > to 3185, 3187 need processing. I've not seen 3186, hence substituted with
    > 295 in the routine, but maybe 3186 should also be included.
    >
    > Don't think above should cause permanent loss of "inserts", but if necessary
    > include "cb.Reset" below "Set cb" and comment everything below except the
    > last Next.
    >
    > Regards,
    > Peter T
    >
    > "Coen" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi guys,
    > >
    > > I'm almost completely lost! I only want to disable (or remove, or change

    > the
    > > action etc) the "Insert Copied Cells" from the row and cell menus. It

    > looks
    > > this can only be done (for the rowmenu) when the sheet is in "row"

    > copymode
    > > and the right mouse menu is visible. And this causes an unwanted

    > sideeffect:
    > > when the "Insert Copied Cells" item has been disabled (or deleted etc),

    > the
    > > same effect is there for the "Insert" item (i.e. insert a row) when the

    > sheet
    > > is not anymore in row-copymode. That's not what I want, the Insert item

    > must
    > > be kept enabled.
    > > Is this really not possible?
    > >
    > >
    > >
    > > But this effects also the
    > >
    > > "Ron de Bruin" wrote:
    > >
    > > > Hi Peter
    > > >
    > > > I will look for a solution when I have time.
    > > > If I find something I will post back.
    > > >
    > > >
    > > >
    > > > --
    > > > Regards Ron de Bruin
    > > > http://www.rondebruin.nl
    > > >
    > > >
    > > >
    > > > "Peter T" <peter_t@discussions> wrote in message

    > news:[email protected]...
    > > > > Hi Ron,
    > > > >
    > > > > This subject is of interest to me to prevent change in layout of

    > cells. I
    > > > > can almost cater for inserted/deleted rows/columns but not inserted

    > cells.
    > > > >
    > > > > The "Insert" ID's change according to:
    > > > > - State of CutCopyMode if cells in clipboard, and
    > > > > - Insert ID is only updated AFTER user has right clicked row/column

    > header,
    > > > > Cell menu, or clicked main Insert menu.
    > > > >
    > > > > Row/Column
    > > > > 3181 "&Insert..."
    > > > > 3183 "&Insert"
    > > > > 3187 "&Insert Copied Cells..."
    > > > > Main Insert Menu
    > > > > 295 "C&ells"
    > > > > 3184 "Copied C&ells..."
    > > > > Cell
    > > > > 3181 "&Insert..."
    > > > > 3185 "Insert Copied C&ells..."
    > > > >
    > > > > It's a real pain! Problem is only the current item can be changed at

    > any one
    > > > > time. Trying all with "On Error Resume Next" doesn't help. Only

    > alternative
    > > > > as far as I can see is to disable the entire respective menus, which I

    > don't
    > > > > want to do. Unless of course you have any other ideas??
    > > > >
    > > > > Regards,
    > > > > Peter T
    > > > >
    > > > > "Ron de Bruin" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > >> It is very strange
    > > > >>
    > > > >> The row and column "Insert" option use the same ID number
    > > > >> But sometimes it say 3181 and the other time 3183.
    > > > >>
    > > > >> I think there is a bug, I will see if I can find a save workaround
    > > > >>
    > > > >>
    > > > >> --
    > > > >> Regards Ron de Bruin
    > > > >> http://www.rondebruin.nl
    > > > >>
    > > > >>
    > > > >>
    > > > >> "Ron de Bruin" <[email protected]> wrote in message
    > > > > news:%[email protected]...
    > > > >> > Hi Coen
    > > > >> >
    > > > >> > I think the best thing that you can do is to disable "Insert"
    > > > >> > It will disable Inset copeid cells also.
    > > > >> >
    > > > >> > This seems to work fine, only the row ID for insert is 3181 but

    > this is
    > > > > not working.
    > > > >> > I am searching the real number now.(I post back)
    > > > >> >
    > > > >> > Sub falsefalse()
    > > > >> > On Error Resume Next
    > > > >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > > > >> > (ID:=295, Recursive:=True).Enabled = False
    > > > >> >
    > > > >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled =

    > False
    > > > >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled =

    > False
    > > > >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled

    > =
    > > > > False
    > > > >> > End Sub
    > > > >> >
    > > > >> > Sub truetrue()
    > > > >> > On Error Resume Next
    > > > >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    > > > >> > (ID:=295, Recursive:=True).Enabled = True
    > > > >> >
    > > > >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled =

    > True
    > > > >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled =

    > True
    > > > >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled

    > =
    > > > > True
    > > > >> > End Sub
    > > > >> >
    > > > >> >
    > > > >> > --
    > > > >> > Regards Ron de Bruin
    > > > >> > http://www.rondebruin.nl

    > >snip<

    >
    >
    >


  20. #20
    Ron de Bruin
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Coen and Peter

    I will see if I have some time this weekend to play with it.

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Coen" <[email protected]> wrote in message news:[email protected]...
    > Hi peter, the reason for disabling only the "Insert Copied Cells" item is
    > that I'm dealing with an vba application (xla) that was build in Excel 97.
    > Now, after upgrading office to 2003, the Excel 2003 version appears to have a
    > nasty problem which only occur while using this "Insert Copied Cells" option.
    > This problem doesn't exist in the '97 version, where "insert copied cells"
    > worked fine. In 2003 using a) copy a row, b) insert a blanc row, and c)
    > paste the row is not causing this problem.
    >
    > Btw: your right, knowing the CutCopyMode status doesn't help me.
    >
    > Regards, Coen.
    >
    > "Peter T" wrote:
    >
    >> Ron - my comment "Trying all with On Error Resume Next doesn't help" was
    >> wrong, see modified version of your routine below.
    >>
    >> Coen - I don't see any way to selectively disable "Insert Copied Cells" from
    >> Row, Column & Cell menus, and "Copied Cells" from main Insert menu, and not
    >> disable the other related menus. But Ron might !
    >>
    >> If you are in a position always to know the state "CutCopyMode" following
    >> should be OK for you, use the "copy mode" version in the Test sub. But I
    >> imagine that's unlikely.
    >>
    >> Curiosity - what's the purpose to disable only "Insert Copied Cells" whilst
    >> allowing "Paste" and "Insert".
    >>
    >> Sub Test()
    >> 'toggle menus
    >> Static bln As Boolean
    >> bln = Not bln
    >> EnableInsertMenus bln
    >>
    >> 'or according to copy mode
    >> 'EnableInsertMenus Not CBool(Application.CutCopyMode)
    >> End Sub
    >>
    >> Sub EnableInsertMenus(bEnable As Boolean)
    >> 'don't forget to run this with True when done
    >> Dim cb As CommandBar, oCtl As Object
    >> Dim va, i As Long, j As Long, nID As Long
    >>
    >> 'Debug.Print
    >> 'Debug.Print "CutCopyMode: " & CBool(Application.CutCopyMode)
    >> 'Debug.Print "Menus Enabled: " & bEnable
    >>
    >> va = Array("Insert", "Cell", "Row", "Column")
    >> On Error Resume Next
    >> For i = LBound(va) To UBound(va)
    >> Set cb = Application.CommandBars(va(i))
    >>
    >> For j = 3181 To 3187
    >> If j = 3186 Then
    >> nID = 295
    >> Else: nID = j
    >> End If
    >>
    >> Set oCtl = cb.FindControl(ID:=nID)
    >> oCtl.Enabled = bEnable
    >>
    >> ' If Err.Number Then
    >> ' Err.Clear
    >> ' Else
    >> ' Debug.Print va(i), oCtl.ID, oCtl.Caption
    >> ' End If
    >> Next
    >> Next
    >>
    >> End Sub
    >>
    >> I stumbled across ID 3182 "C&ells" in the main Insert menu. Seems ID's 3181
    >> to 3185, 3187 need processing. I've not seen 3186, hence substituted with
    >> 295 in the routine, but maybe 3186 should also be included.
    >>
    >> Don't think above should cause permanent loss of "inserts", but if necessary
    >> include "cb.Reset" below "Set cb" and comment everything below except the
    >> last Next.
    >>
    >> Regards,
    >> Peter T
    >>
    >> "Coen" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Hi guys,
    >> >
    >> > I'm almost completely lost! I only want to disable (or remove, or change

    >> the
    >> > action etc) the "Insert Copied Cells" from the row and cell menus. It

    >> looks
    >> > this can only be done (for the rowmenu) when the sheet is in "row"

    >> copymode
    >> > and the right mouse menu is visible. And this causes an unwanted

    >> sideeffect:
    >> > when the "Insert Copied Cells" item has been disabled (or deleted etc),

    >> the
    >> > same effect is there for the "Insert" item (i.e. insert a row) when the

    >> sheet
    >> > is not anymore in row-copymode. That's not what I want, the Insert item

    >> must
    >> > be kept enabled.
    >> > Is this really not possible?
    >> >
    >> >
    >> >
    >> > But this effects also the
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> > > Hi Peter
    >> > >
    >> > > I will look for a solution when I have time.
    >> > > If I find something I will post back.
    >> > >
    >> > >
    >> > >
    >> > > --
    >> > > Regards Ron de Bruin
    >> > > http://www.rondebruin.nl
    >> > >
    >> > >
    >> > >
    >> > > "Peter T" <peter_t@discussions> wrote in message

    >> news:[email protected]...
    >> > > > Hi Ron,
    >> > > >
    >> > > > This subject is of interest to me to prevent change in layout of

    >> cells. I
    >> > > > can almost cater for inserted/deleted rows/columns but not inserted

    >> cells.
    >> > > >
    >> > > > The "Insert" ID's change according to:
    >> > > > - State of CutCopyMode if cells in clipboard, and
    >> > > > - Insert ID is only updated AFTER user has right clicked row/column

    >> header,
    >> > > > Cell menu, or clicked main Insert menu.
    >> > > >
    >> > > > Row/Column
    >> > > > 3181 "&Insert..."
    >> > > > 3183 "&Insert"
    >> > > > 3187 "&Insert Copied Cells..."
    >> > > > Main Insert Menu
    >> > > > 295 "C&ells"
    >> > > > 3184 "Copied C&ells..."
    >> > > > Cell
    >> > > > 3181 "&Insert..."
    >> > > > 3185 "Insert Copied C&ells..."
    >> > > >
    >> > > > It's a real pain! Problem is only the current item can be changed at

    >> any one
    >> > > > time. Trying all with "On Error Resume Next" doesn't help. Only

    >> alternative
    >> > > > as far as I can see is to disable the entire respective menus, which I

    >> don't
    >> > > > want to do. Unless of course you have any other ideas??
    >> > > >
    >> > > > Regards,
    >> > > > Peter T
    >> > > >
    >> > > > "Ron de Bruin" <[email protected]> wrote in message
    >> > > > news:[email protected]...
    >> > > >> It is very strange
    >> > > >>
    >> > > >> The row and column "Insert" option use the same ID number
    >> > > >> But sometimes it say 3181 and the other time 3183.
    >> > > >>
    >> > > >> I think there is a bug, I will see if I can find a save workaround
    >> > > >>
    >> > > >>
    >> > > >> --
    >> > > >> Regards Ron de Bruin
    >> > > >> http://www.rondebruin.nl
    >> > > >>
    >> > > >>
    >> > > >>
    >> > > >> "Ron de Bruin" <[email protected]> wrote in message
    >> > > > news:%[email protected]...
    >> > > >> > Hi Coen
    >> > > >> >
    >> > > >> > I think the best thing that you can do is to disable "Insert"
    >> > > >> > It will disable Inset copeid cells also.
    >> > > >> >
    >> > > >> > This seems to work fine, only the row ID for insert is 3181 but

    >> this is
    >> > > > not working.
    >> > > >> > I am searching the real number now.(I post back)
    >> > > >> >
    >> > > >> > Sub falsefalse()
    >> > > >> > On Error Resume Next
    >> > > >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    >> > > >> > (ID:=295, Recursive:=True).Enabled = False
    >> > > >> >
    >> > > >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled =

    >> False
    >> > > >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled =

    >> False
    >> > > >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled

    >> =
    >> > > > False
    >> > > >> > End Sub
    >> > > >> >
    >> > > >> > Sub truetrue()
    >> > > >> > On Error Resume Next
    >> > > >> > Application.CommandBars("Worksheet Menu Bar").FindControl _
    >> > > >> > (ID:=295, Recursive:=True).Enabled = True
    >> > > >> >
    >> > > >> > Application.CommandBars("Cell").FindControl(ID:=3181).Enabled =

    >> True
    >> > > >> > 'Application.CommandBars("Row").FindControl(ID:=3181).Enabled =

    >> True
    >> > > >> > Application.CommandBars("Column").FindControl(ID:=3183).Enabled

    >> =
    >> > > > True
    >> > > >> > End Sub
    >> > > >> >
    >> > > >> >
    >> > > >> > --
    >> > > >> > Regards Ron de Bruin
    >> > > >> > http://www.rondebruin.nl
    >> >snip<

    >>
    >>
    >>




  21. #21
    Peter T
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Coen,

    I've noticed a number of issues in this ng concerning paste & XL2003. By
    coincidence someone has just tagged similar on to the end of this Sept 2003
    thread, after a short comment of mine.

    Subject: XL2003 "paste method of worksheet class failed"
    http://tinyurl.com/7xp7e

    Rather than disabling menu items, it might be worth getting to the route of
    the problem and warrent a new post. Fully describe your "nasty problem" and
    under what circumstances it occurs.

    Regards,
    Peter T

    "Coen" <[email protected]> wrote in message
    news:[email protected]...
    > Hi peter, the reason for disabling only the "Insert Copied Cells" item is
    > that I'm dealing with an vba application (xla) that was build in Excel 97.
    > Now, after upgrading office to 2003, the Excel 2003 version appears to

    have a
    > nasty problem which only occur while using this "Insert Copied Cells"

    option.
    > This problem doesn't exist in the '97 version, where "insert copied cells"
    > worked fine. In 2003 using a) copy a row, b) insert a blanc row, and c)
    > paste the row is not causing this problem.
    >
    > Btw: your right, knowing the CutCopyMode status doesn't help me.
    >
    > Regards, Coen.
    >
    > "Peter T" wrote:
    >
    > > Ron - my comment "Trying all with On Error Resume Next doesn't help" was
    > > wrong, see modified version of your routine below.
    > >
    > > Coen - I don't see any way to selectively disable "Insert Copied Cells"

    from
    > > Row, Column & Cell menus, and "Copied Cells" from main Insert menu, and

    not
    > > disable the other related menus. But Ron might !
    > >
    > > If you are in a position always to know the state "CutCopyMode"

    following
    > > should be OK for you, use the "copy mode" version in the Test sub. But

    I
    > > imagine that's unlikely.
    > >
    > > Curiosity - what's the purpose to disable only "Insert Copied Cells"

    whilst
    > > allowing "Paste" and "Insert".
    > >
    > > Sub Test()
    > > 'toggle menus
    > > Static bln As Boolean
    > > bln = Not bln
    > > EnableInsertMenus bln
    > >
    > > 'or according to copy mode
    > > 'EnableInsertMenus Not CBool(Application.CutCopyMode)
    > > End Sub
    > >
    > > Sub EnableInsertMenus(bEnable As Boolean)
    > > 'don't forget to run this with True when done
    > > Dim cb As CommandBar, oCtl As Object
    > > Dim va, i As Long, j As Long, nID As Long
    > >
    > > 'Debug.Print
    > > 'Debug.Print "CutCopyMode: " & CBool(Application.CutCopyMode)
    > > 'Debug.Print "Menus Enabled: " & bEnable
    > >
    > > va = Array("Insert", "Cell", "Row", "Column")
    > > On Error Resume Next
    > > For i = LBound(va) To UBound(va)
    > > Set cb = Application.CommandBars(va(i))
    > >
    > > For j = 3181 To 3187
    > > If j = 3186 Then
    > > nID = 295
    > > Else: nID = j
    > > End If
    > >
    > > Set oCtl = cb.FindControl(ID:=nID)
    > > oCtl.Enabled = bEnable
    > >
    > > ' If Err.Number Then
    > > ' Err.Clear
    > > ' Else
    > > ' Debug.Print va(i), oCtl.ID, oCtl.Caption
    > > ' End If
    > > Next
    > > Next
    > >
    > > End Sub
    > >
    > > I stumbled across ID 3182 "C&ells" in the main Insert menu. Seems ID's

    3181
    > > to 3185, 3187 need processing. I've not seen 3186, hence substituted

    with
    > > 295 in the routine, but maybe 3186 should also be included.
    > >
    > > Don't think above should cause permanent loss of "inserts", but if

    necessary
    > > include "cb.Reset" below "Set cb" and comment everything below except

    the
    > > last Next.
    > >
    > > Regards,
    > > Peter T

    >snip<




  22. #22
    Coen
    Guest

    Re: How to disable the "Insert Copied Cells" context menu item

    Hi Ron and Peter,

    I agree, and I have decided to focus on the real problem. Disabling this
    menuitem won't be a succesfull solution. Thanks for all the help.

    Regards Coen.

    "Peter T" wrote:

    > Hi Coen,
    >
    > I've noticed a number of issues in this ng concerning paste & XL2003. By
    > coincidence someone has just tagged similar on to the end of this Sept 2003
    > thread, after a short comment of mine.
    >
    > Subject: XL2003 "paste method of worksheet class failed"
    > http://tinyurl.com/7xp7e
    >
    > Rather than disabling menu items, it might be worth getting to the route of
    > the problem and warrent a new post. Fully describe your "nasty problem" and
    > under what circumstances it occurs.
    >
    > Regards,
    > Peter T
    >
    > "Coen" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi peter, the reason for disabling only the "Insert Copied Cells" item is
    > > that I'm dealing with an vba application (xla) that was build in Excel 97.
    > > Now, after upgrading office to 2003, the Excel 2003 version appears to

    > have a
    > > nasty problem which only occur while using this "Insert Copied Cells"

    > option.
    > > This problem doesn't exist in the '97 version, where "insert copied cells"
    > > worked fine. In 2003 using a) copy a row, b) insert a blanc row, and c)
    > > paste the row is not causing this problem.
    > >
    > > Btw: your right, knowing the CutCopyMode status doesn't help me.
    > >
    > > Regards, Coen.
    > >
    > > "Peter T" wrote:
    > >
    > > > Ron - my comment "Trying all with On Error Resume Next doesn't help" was
    > > > wrong, see modified version of your routine below.
    > > >
    > > > Coen - I don't see any way to selectively disable "Insert Copied Cells"

    > from
    > > > Row, Column & Cell menus, and "Copied Cells" from main Insert menu, and

    > not
    > > > disable the other related menus. But Ron might !
    > > >
    > > > If you are in a position always to know the state "CutCopyMode"

    > following
    > > > should be OK for you, use the "copy mode" version in the Test sub. But

    > I
    > > > imagine that's unlikely.
    > > >
    > > > Curiosity - what's the purpose to disable only "Insert Copied Cells"

    > whilst
    > > > allowing "Paste" and "Insert".
    > > >
    > > > Sub Test()
    > > > 'toggle menus
    > > > Static bln As Boolean
    > > > bln = Not bln
    > > > EnableInsertMenus bln
    > > >
    > > > 'or according to copy mode
    > > > 'EnableInsertMenus Not CBool(Application.CutCopyMode)
    > > > End Sub
    > > >
    > > > Sub EnableInsertMenus(bEnable As Boolean)
    > > > 'don't forget to run this with True when done
    > > > Dim cb As CommandBar, oCtl As Object
    > > > Dim va, i As Long, j As Long, nID As Long
    > > >
    > > > 'Debug.Print
    > > > 'Debug.Print "CutCopyMode: " & CBool(Application.CutCopyMode)
    > > > 'Debug.Print "Menus Enabled: " & bEnable
    > > >
    > > > va = Array("Insert", "Cell", "Row", "Column")
    > > > On Error Resume Next
    > > > For i = LBound(va) To UBound(va)
    > > > Set cb = Application.CommandBars(va(i))
    > > >
    > > > For j = 3181 To 3187
    > > > If j = 3186 Then
    > > > nID = 295
    > > > Else: nID = j
    > > > End If
    > > >
    > > > Set oCtl = cb.FindControl(ID:=nID)
    > > > oCtl.Enabled = bEnable
    > > >
    > > > ' If Err.Number Then
    > > > ' Err.Clear
    > > > ' Else
    > > > ' Debug.Print va(i), oCtl.ID, oCtl.Caption
    > > > ' End If
    > > > Next
    > > > Next
    > > >
    > > > End Sub
    > > >
    > > > I stumbled across ID 3182 "C&ells" in the main Insert menu. Seems ID's

    > 3181
    > > > to 3185, 3187 need processing. I've not seen 3186, hence substituted

    > with
    > > > 295 in the routine, but maybe 3186 should also be included.
    > > >
    > > > Don't think above should cause permanent loss of "inserts", but if

    > necessary
    > > > include "cb.Reset" below "Set cb" and comment everything below except

    > the
    > > > last Next.
    > > >
    > > > Regards,
    > > > Peter T

    > >snip<

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1