+ Reply to Thread
Results 1 to 9 of 9

How to create new workbook with custom ribbon in VBA

  1. #1
    Registered User
    Join Date
    11-23-2013
    Location
    Krakow, Poland
    MS-Off Ver
    Excel 2010
    Posts
    4

    How to create new workbook with custom ribbon in VBA

    I created a workbook with multiple macros and a customized ribbon. One of the subs creates a new workbook. I would like to have the same custom ribbon in the new workbook. Is that achievable through VBA? Is there a way to export/import customUI files with VBA?

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to create new workbook with custom ribbon in VBA

    LOL

    Sorry Michal your thinking is too literal.

    Instead of creating a new workbook, why not save your existing workbook under a new name.

    Then add the new sheets you want and delete those you don't want.

    Your Customised ribbon should remain in the new workbook.

  3. #3
    Registered User
    Join Date
    11-23-2013
    Location
    Krakow, Poland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How to create new workbook with custom ribbon in VBA

    OK, this trick should do the job in my case, so thanks.
    But taking it one step further - what if I wanted to have the new file with a different ribbon customization? Is it possible to import/export customUI files or modify them through VBA?
    Or maybe it's possible to turn some buttons visible/invisible?

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: How to create new workbook with custom ribbon in VBA

    Yes, it is possible to make buttons visible/invisible (getVisible). You can also make dynamic menus.

    One way is to make the ribbon into an add-in.

  5. #5
    Registered User
    Join Date
    11-23-2013
    Location
    Krakow, Poland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How to create new workbook with custom ribbon in VBA

    GetVisible is what I'll go with. Thanks!

  6. #6
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: How to create new workbook with custom ribbon in VBA

    Great, getVisible is really quite useful!

  7. #7
    Registered User
    Join Date
    11-23-2013
    Location
    Krakow, Poland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How to create new workbook with custom ribbon in VBA

    I have one more question regarding making the ribbon into an add-in. I read a bit about add-ins as I never used them before (conciously) and it seems like that might be an elegant and easy way to achieve what I need.
    The macro I'm working on is going to be used in my company by multiple users, probably in different locations as well. The question is how would I distribute the workbook with references to an add-in. Do I need to deliver two separate files (original macro and add-in file) or is there a way to incorporate the add-in into the macro (like customUI file).
    Sorry if this question sounds silly, as I said I'm new to the add-in concept.

  8. #8
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: How to create new workbook with custom ribbon in VBA

    It's not my forte, but I'll try to give you a bit of an idea how I see it.

    It works like a workbook, with customUI and everything, but the worksheets are not shown.

    You can for instance make one of your workbooks with the Ribbon into an Add-in by:

    Please Login or Register  to view this content.
    then resave it as an .xlam-file

    The worksheets in the Add-in, not shown directly, can be used to store data used by your scripts, etc.

  9. #9
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: How to create new workbook with custom ribbon in VBA

    When working with an Add-in, it's important to write the code for the particular workbook you work with as "Activeworkbook" and when you may want to use data or preferences stored in the Add-in you use "Thisworkbook".

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Custom Ribbon
    By Tortus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2013, 08:52 AM
  2. Excel 2007 : How to reload a Custom Ribbon using VBA
    By ravikiran in forum Excel General
    Replies: 2
    Last Post: 03-23-2012, 04:46 AM
  3. Custom Ribbon Add-in
    By yawnzzzz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2011, 09:46 AM
  4. Slow opening for workbook with custom ribbon.
    By ericsastud in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2011, 11:09 AM
  5. Excel 2007 : Custom Ribbon
    By LB79 in forum Excel General
    Replies: 23
    Last Post: 10-07-2010, 06:27 AM

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