+ Reply to Thread
Results 1 to 5 of 5

VBE toolbar not ready for cutomizations

  1. #1
    Hari Prasadh
    Guest

    VBE toolbar not ready for cutomizations

    Hi,

    Some of my toolbars within VBE are missing. Like -- comment block, uncomment
    block -- etc. They are neither on the main toolbar and nor within the Edit
    menu.

    So I right clicked on the toolbar and Customize - and dragged the needed
    icons to my standard toolbar.

    I work for some time and then close excel (I save the workbooks). I restart
    Excel- Alt + F11--- Lo! the comment and uncomment block is again Missing!

    And I have tried this many times, but somehow the VBE is adamant in not
    getting *customized*.

    Why is it happening? Please note I have customized toolbars in Normal excel
    and they work perfectly fine. Any time I make changes to my normal excel
    toolbar they would stay that way , next time I open Excel the changes would
    have got applied. (I have the Excel10.xlb in my C:\Documents and
    Settings\abc\Application Data\Microsoft\Excel).

    Please guide me.

    Thanks a lot,
    Hari
    India



  2. #2
    keepITcool
    Guest

    Re: VBE toolbar not ready for cutomizations

    Hari,

    commandbars can have their Protection property set, thus disabling
    customization.

    in most cases you CAN set the protection to 0, but for some builtin bars
    you cannot change it.

    it's a good idea to reset the original protection after you've made
    your changes.

    dim lngProt as long
    with commandbars(x)
    lngprot = .protection
    .protection=0
    if protection = 0 then
    'do your stuff
    else
    debug.print "cannot unprotect CB:" & .name
    endif
    .protection = lngprot
    end with


    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    Hari Prasadh wrote :

    > Hi,
    >
    > Some of my toolbars within VBE are missing. Like -- comment block,
    > uncomment block -- etc. They are neither on the main toolbar and nor
    > within the Edit menu.
    >
    > So I right clicked on the toolbar and Customize - and dragged the
    > needed icons to my standard toolbar.
    >
    > I work for some time and then close excel (I save the workbooks). I
    > restart Excel- Alt + F11--- Lo! the comment and uncomment block is
    > again Missing!
    >
    > And I have tried this many times, but somehow the VBE is adamant in
    > not getting customized.
    >
    > Why is it happening? Please note I have customized toolbars in Normal
    > excel and they work perfectly fine. Any time I make changes to my
    > normal excel toolbar they would stay that way , next time I open
    > Excel the changes would have got applied. (I have the Excel10.xlb in
    > my C:\Documents and Settings\abc\Application Data\Microsoft\Excel).
    >
    > Please guide me.
    >
    > Thanks a lot,
    > Hari
    > India


  3. #3
    Hari Prasadh
    Guest

    Re: VBE toolbar not ready for cutomizations

    Hi KeepITcool,

    Im sorry, I dont know how to proceed ahead.

    I pasted your code on to my personal workbook as it is by including sub and
    end sub.

    I got an error for
    a) -- with commandbars(x) -- variable not defined.. I included the following
    statement -- Dim x As Integer
    b) Then I got a compile error for -- if protection = 0 then -- Variable not
    defined -- I changed it, by putting a period before protection
    c) The I re-ran the whole thing. I got a run-time error '9' for subsript out
    of range within line -- with commandbars(x) -- I changed Dim x As Integer
    to Dim x As Long
    d) Then i again got the same error. I changed it to -- Dim x As String -- I
    got run time error '5' , invalid procedure call or argument.

    1) What should I define -- x as--

    2) What code would I have to write within -- 'do your stuff --

    Please guide me.

    Thanks a lot,
    Hari
    India

    "keepITcool" <[email protected]> wrote in message
    news:[email protected]...
    > Hari,
    >
    > commandbars can have their Protection property set, thus disabling
    > customization.
    >
    > in most cases you CAN set the protection to 0, but for some builtin bars
    > you cannot change it.
    >
    > it's a good idea to reset the original protection after you've made
    > your changes.
    >
    > dim lngProt as long
    > with commandbars(x)
    > lngprot = .protection
    > .protection=0
    > if protection = 0 then
    > 'do your stuff
    > else
    > debug.print "cannot unprotect CB:" & .name
    > endif
    > .protection = lngprot
    > end with
    >
    >
    > --
    > keepITcool
    > | www.XLsupport.com | keepITcool chello nl | amsterdam
    >
    >
    > Hari Prasadh wrote :
    >
    >> Hi,
    >>
    >> Some of my toolbars within VBE are missing. Like -- comment block,
    >> uncomment block -- etc. They are neither on the main toolbar and nor
    >> within the Edit menu.
    >>
    >> So I right clicked on the toolbar and Customize - and dragged the
    >> needed icons to my standard toolbar.
    >>
    >> I work for some time and then close excel (I save the workbooks). I
    >> restart Excel- Alt + F11--- Lo! the comment and uncomment block is
    >> again Missing!
    >>
    >> And I have tried this many times, but somehow the VBE is adamant in
    >> not getting customized.
    >>
    >> Why is it happening? Please note I have customized toolbars in Normal
    >> excel and they work perfectly fine. Any time I make changes to my
    >> normal excel toolbar they would stay that way , next time I open
    >> Excel the changes would have got applied. (I have the Excel10.xlb in
    >> my C:\Documents and Settings\abc\Application Data\Microsoft\Excel).
    >>
    >> Please guide me.
    >>
    >> Thanks a lot,
    >> Hari
    >> India




  4. #4
    keepITcool
    Guest

    Re: VBE toolbar not ready for cutomizations

    Hari,


    I'm sorry, my code was NOT meant for cut & paste, but rather as an
    example for you to study.

    First:
    Look in VBA help for Protection property on Commandbar object.




    Second:

    dim x as string
    x="Standard"

    compile error:
    protection s/b .Protection


    hth

    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    Hari Prasadh wrote :

    > Hi KeepITcool,
    >
    > Im sorry, I dont know how to proceed ahead.
    >
    > I pasted your code on to my personal workbook as it is by including
    > sub and end sub.
    >
    > I got an error for
    > a) -- with commandbars(x) -- variable not defined.. I included the
    > following statement -- Dim x As Integer
    > b) Then I got a compile error for -- if protection = 0 then --
    > Variable not defined -- I changed it, by putting a period before
    > protection c) The I re-ran the whole thing. I got a run-time error
    > '9' for subsript out of range within line -- with commandbars(x) --
    > I changed Dim x As Integer to Dim x As Long
    > d) Then i again got the same error. I changed it to -- Dim x As
    > String -- I got run time error '5' , invalid procedure call or
    > argument.
    >
    > 1) What should I define -- x as--
    >
    > 2) What code would I have to write within -- 'do your stuff --
    >
    > Please guide me.
    >
    > Thanks a lot,
    > Hari
    > India
    >
    > "keepITcool" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hari,
    > >
    > > commandbars can have their Protection property set, thus disabling
    > > customization.
    > >
    > > in most cases you CAN set the protection to 0, but for some builtin
    > > bars you cannot change it.
    > >
    > > it's a good idea to reset the original protection after you've made
    > > your changes.
    > >
    > > dim lngProt as long
    > > with commandbars(x)
    > > lngprot = .protection
    > > .protection=0
    > > if protection = 0 then
    > > 'do your stuff
    > > else
    > > debug.print "cannot unprotect CB:" & .name
    > > endif
    > > .protection = lngprot
    > > end with
    > >
    > >
    > > --
    > > keepITcool
    > > > www.XLsupport.com | keepITcool chello nl | amsterdam

    > >
    > >
    > > Hari Prasadh wrote :
    > >
    > >> Hi,
    > > >
    > >> Some of my toolbars within VBE are missing. Like -- comment block,
    > >> uncomment block -- etc. They are neither on the main toolbar and

    > nor >> within the Edit menu.
    > > >
    > >> So I right clicked on the toolbar and Customize - and dragged the
    > >> needed icons to my standard toolbar.
    > > >
    > >> I work for some time and then close excel (I save the workbooks). I
    > >> restart Excel- Alt + F11--- Lo! the comment and uncomment block is
    > >> again Missing!
    > > >
    > >> And I have tried this many times, but somehow the VBE is adamant in
    > >> not getting customized.
    > > >
    > >> Why is it happening? Please note I have customized toolbars in

    > Normal >> excel and they work perfectly fine. Any time I make changes
    > to my >> normal excel toolbar they would stay that way , next time I
    > open >> Excel the changes would have got applied. (I have the
    > Excel10.xlb in >> my C:\Documents and Settings\abc\Application
    > Data\Microsoft\Excel).
    > > >
    > >> Please guide me.
    > > >
    > >> Thanks a lot,
    > >> Hari
    > >> India


  5. #5
    Hari Prasadh
    Guest

    Re: VBE toolbar not ready for cutomizations

    Hi keepITcool,

    Thnx for the directions. Would try it out and post back in case of a
    problem.

    Thanks a lot,
    Hari
    India

    "keepITcool" <[email protected]> wrote in message
    news:[email protected]...
    > Hari,
    >
    >
    > I'm sorry, my code was NOT meant for cut & paste, but rather as an
    > example for you to study.
    >
    > First:
    > Look in VBA help for Protection property on Commandbar object.
    >
    >
    >
    >
    > Second:
    >
    > dim x as string
    > x="Standard"
    >
    > compile error:
    > protection s/b .Protection
    >
    >
    > hth
    >
    > --
    > keepITcool
    > | www.XLsupport.com | keepITcool chello nl | amsterdam
    >
    >
    > Hari Prasadh wrote :
    >
    >> Hi KeepITcool,
    >>
    >> Im sorry, I dont know how to proceed ahead.
    >>
    >> I pasted your code on to my personal workbook as it is by including
    >> sub and end sub.
    >>
    >> I got an error for
    >> a) -- with commandbars(x) -- variable not defined.. I included the
    >> following statement -- Dim x As Integer
    >> b) Then I got a compile error for -- if protection = 0 then --
    >> Variable not defined -- I changed it, by putting a period before
    >> protection c) The I re-ran the whole thing. I got a run-time error
    >> '9' for subsript out of range within line -- with commandbars(x) --
    >> I changed Dim x As Integer to Dim x As Long
    >> d) Then i again got the same error. I changed it to -- Dim x As
    >> String -- I got run time error '5' , invalid procedure call or
    >> argument.
    >>
    >> 1) What should I define -- x as--
    >>
    >> 2) What code would I have to write within -- 'do your stuff --
    >>
    >> Please guide me.
    >>
    >> Thanks a lot,
    >> Hari
    >> India
    >>
    >> "keepITcool" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Hari,
    >> >
    >> > commandbars can have their Protection property set, thus disabling
    >> > customization.
    >> >
    >> > in most cases you CAN set the protection to 0, but for some builtin
    >> > bars you cannot change it.
    >> >
    >> > it's a good idea to reset the original protection after you've made
    >> > your changes.
    >> >
    >> > dim lngProt as long
    >> > with commandbars(x)
    >> > lngprot = .protection
    >> > .protection=0
    >> > if protection = 0 then
    >> > 'do your stuff
    >> > else
    >> > debug.print "cannot unprotect CB:" & .name
    >> > endif
    >> > .protection = lngprot
    >> > end with
    >> >
    >> >
    >> > --
    >> > keepITcool
    >> > > www.XLsupport.com | keepITcool chello nl | amsterdam
    >> >
    >> >
    >> > Hari Prasadh wrote :
    >> >
    >> >> Hi,
    >> > >
    >> >> Some of my toolbars within VBE are missing. Like -- comment block,
    >> >> uncomment block -- etc. They are neither on the main toolbar and

    >> nor >> within the Edit menu.
    >> > >
    >> >> So I right clicked on the toolbar and Customize - and dragged the
    >> >> needed icons to my standard toolbar.
    >> > >
    >> >> I work for some time and then close excel (I save the workbooks). I
    >> >> restart Excel- Alt + F11--- Lo! the comment and uncomment block is
    >> >> again Missing!
    >> > >
    >> >> And I have tried this many times, but somehow the VBE is adamant in
    >> >> not getting customized.
    >> > >
    >> >> Why is it happening? Please note I have customized toolbars in

    >> Normal >> excel and they work perfectly fine. Any time I make changes
    >> to my >> normal excel toolbar they would stay that way , next time I
    >> open >> Excel the changes would have got applied. (I have the
    >> Excel10.xlb in >> my C:\Documents and Settings\abc\Application
    >> Data\Microsoft\Excel).
    >> > >
    >> >> Please guide me.
    >> > >
    >> >> Thanks a lot,
    >> >> Hari
    >> >> India




+ 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