Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    Estonia
    Posts
    2

    Question Unanswered: Copy CommandBars

    Hi!

    I find myself banging my head against the wall trying to copy a CommandBar from one db to another in code. I am opening the other db as a New Access.Object and I've tried various versions of the widely suggested (also on MSDN) code

    For Each cbrCtl In cbrOriginal.Controls
    cbrCtl.Copy cbrCopy
    Next cbrCtl

    I have MS Office Object Library 9.0 enabled in the file I'm trying to copy from and I've tried en/disabling it in the file I'm copying to, but with no luck.

    on the .Copy line a keep getting the error message "Invalid procedure call or argument". However, everything works fine when I copy the toolbar withing the same db (which doesn't have much practical value :-( )

    I'm getting pretty hopeless here, so any help will be greatly appreciated!!

    thanks in advance,

    M

  2. #2
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251

    Re: Copy CommandBars

    maybe I'm wrong, but I guess you cannot simply copy toolbars between containers. I think you have to create code for copying each item....

    :-(


    if it is one time copy, go to File-Import select your MDB and import only MENUS and TOOLBARS .... it's manual work.


    i found a code, which may help.....

    http://smsconsulting.spb.ru/shamil_s...s/copycmdb.htm




    jiri

  3. #3
    Join Date
    Dec 2002
    Location
    Estonia
    Posts
    2

    Red face Re: Copy CommandBars

    Thanks playernovis,

    I'll have to work on the code suggested by shamil (it must be adjusted a bit) as I'm making an update tool to update a number of external .mdb files, so manual copying wouldn't be an appreciated option :-(

    I was hoping there would be a lighter solution to this problem, but on the other hand it would be great to have just anything that works! ;-)

    regards,
    M

Posting Permissions

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