+ Reply to Thread
Results 1 to 6 of 6

Disappearing Custom toolbars.

  1. #1
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Disappearing Custom toolbars.

    I'm using Excel 2003 VBA on windows 10.
    I have two Excel files open, each of which has it's own VBA generated custom command bars.
    If I switch between them using the "Window" button on the standard menu bar, my custom command bars are retained correctly.
    However, if I close one of the files using the code “ActiveWorkbook.Close”, the other file appears but minus the custom bars.
    BUT if I close the file using the yellow file close icon on the standard toolbar, the other file appears complete with custom toolbars.
    I want to use “ActiveWorkbook.Close”, as there is other associated code in my ‘close’ module.
    What’s happening here?

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Disappearing Custom toolbars.

    .
    Does it function as needed if you use the command : ThisWorkbook.Close ?

  3. #3
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Disappearing Custom toolbars.

    Hi Logit

    Thank you for your reply.

    Unfortunately ThisWorkbook.Close made no difference.

    What I don’t understand is that when I use this code to close one file and the other appears (minus custom bars) no [ Activate] event is triggered.

    However, using the menu bar yellow Close icon, a Workbook_Activate procedure (where I have code to generate the custom bars) is triggered and the bars are preserved.

    It’s this apparent inconsistency I can’t unravel.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Disappearing Custom toolbars.

    .
    Interesting puzzle. My experience with Custom Tool Bars is ZILCH ... I'm not going to be any help.
    But I am going to follow this thread to see what other, more informed folks have to say.

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: Disappearing Custom toolbars.

    It might help if you could post the full code that closes the other workbook.
    Rory

  6. #6
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Disappearing Custom toolbars.

    I have posted the 2 folders Test_CB1.xls & Test_CB2.xls
    Test_CB2.xls has an ‘extra’ module called CloseMe.
    If both folders are opened, and Test_CB2.xls selected, using the standard toolbar yellow close icon closes the file and when Test_CB1.xls appears, it shows CBBar_2 intact.
    However if the procedure is repeated and Test_CB2.xls is closed using the CloseMe module in VBA, then when Test_CB1.xls appears, it is minus the CBBar_2 toolbar.
    This is the problem.
    Attached Files Attached Files

+ 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. Custom toolbars
    By confused99 in forum Excel General
    Replies: 1
    Last Post: 09-20-2009, 12:50 PM
  2. Custom Toolbars
    By Nigel RS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2006, 04:45 AM
  3. Custom toolbars (not again!!!)
    By Sharon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2006, 10:30 AM
  4. Custom Toolbars Again!!!
    By Sharon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2006, 05:00 AM
  5. Custom Toolbars?
    By Sharon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2006, 10:25 AM
  6. Custom Toolbars
    By blackfish in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2005, 05:40 PM
  7. menus and toolbars disappearing in excel 2003
    By Sam in forum Excel General
    Replies: 1
    Last Post: 07-04-2005, 11:05 PM
  8. menus and toolbars disappearing in excel 2003
    By Sam in forum Excel General
    Replies: 1
    Last Post: 07-04-2005, 11:05 PM

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