Custom Ribbon Menus Don't Work Until Save, Close & Re-Open

Feb 15, 2010

Created a new tab and menu buttons on the Ribbon in Excel in 3 separate .xltm files. Everything worked great through all of the development and testing, but when we went live we got reports of a bug. Here is what is happening...

User opens the template file and immediately saves it as a .xlsm file with a new name in a new location. The user then does various amounts of work in the file. When the user needs to use one of the tools on the custom tab, it is as if the buttons are inactive or not associated with any actions. The tab and buttons are all visible, the animation of the button being pressed works when any of the buttons are clicked, but nothing happens. The user can close and reopen the file and the ribbon buttons will work correctly, but not until they close and reopen.

Upon digging into the problem, we found that if the user clicks on the custom tab before they save the file, all of the buttons will work correctly after the save. But if the tab is not activated before the save, they dont work until a close and reopen.

The XML code is good because if I place it in a add on file (.xlam) and trigger it from the main file, there is no problem. But this is not a good solution since the add on file needs to be located in the same file that the main file is run from which can be any number of places.

View 3 Replies


ADVERTISEMENT

Default Ribbon To Open Custom Tab Not Home Tab

Jul 15, 2014

I created a custom tab withthe UI editor into my personal sheet which is set as startup and I want to have this tab automaticly shown when it is opened.

So when the workbook is opened I would like the show the tab Andre rather than the home tab.

View 4 Replies View Related

How To Open A Workbook When Select Custom Tab In Ribbon Menu

Oct 5, 2012

I am working on building a custom menu and I am looking for the code that would open a specific workbook execute a macro when I select the tab, can this be done????

View 1 Replies View Related

Custom Save On Close Box

Jun 21, 2007

Is it possible to stop excel bringing up the save changes box? or replace it with my own custom box? ive tried this code, but it seems to run the userform twice#~?

Application.DisplayAlerts = False
Before_Save.Hide
ThisWorkbook.Saved = False
ThisWorkbook.Close

i triggered it to load on workbook close, but like i say, it seems to run it twice? maybe i need to tell it to only run once or something?

View 2 Replies View Related

Macro Code To Create Custom Menus & Sub Menus

Jun 9, 2008

I am using the following code to create a custom command menu.

Sub AddMenus()
Dim cMenu1 As CommandBarControl
Dim cbMainMenuBar As CommandBar
Dim iHelpMenu As Integer
Dim cbcCustomMenu As CommandBarControl
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("&New Menu").Delete
On Error Goto 0
Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar")..........................

I want to add a new button control at the bottom of the menu underneath the holiday control but it keeps adding it on the sub menu, which leads off the holiday button control. I want the menu to look like this.

Open Net 2 Access
Add Employee
Edit Employee
Delete Employee
Holidays (3 options on sub menu)
*New Control

View 4 Replies View Related

Custom Menus And Sub Menus For 2007

Feb 3, 2010

From this link: [url]

there is some clever code to create a customized menu in a dynamic Add-Ins section of the Excel ribbon; this section disappears when the workbook is deactivated and re-appears when it is activated. The custom menu has 2 main items each of which can launch a macro. There is also a 3rd main item called "Next Menu" which cascades nicely to a sub-menu. That sub-menu can have several items of its own. Very cool code.

However, I am trying to add a 4th item in the main menu, say, "Next Menu2" which also cascades to a sub-menu. The problem I'm having is when I try to replicate this code to accomplish this, "Next Menu2" appears in the sub-menu of "Next Menu", rather than as a separate (4th) main item below "Next Menu".

I believe there was another post (not sure of the date, but has since expired) which asked basically the same question as mine. There was a reply with code saying "This should work" but when I tried it, it didn't help.

View 3 Replies View Related

Macro To Open / Close / Save Workbook?

Mar 14, 2014

I need to have a workbook (all of them in a folder, ideally) refresh in the middle of the night. The file is large so the refresh takes a full minute. I know I can't auto refresh a closed workbook (pretty sure anyway), and I can't leave the workbook open for various reasons.

So I'm thinking I could have a macro in an open excel (it kicks off on open) that will open a particular workbook elsewhere (the one I need refreshed), open it, refresh it and close/save it. Ideally it would do this for the entire group of workbooks in the folder but I'd be happy to start with just one. I would like to set it to occur every twelve hours (so at midnight, say, this would occur - I would just have to leave the workbook with the macro in it open on a computer so that it runs and completes this task every night).

View 7 Replies View Related

Cascaded Open / Close / Save Not Working

Aug 3, 2009

I have a 'Summary' workbook which collates values from a series of 'sub-workbooks', (and can also update values in those sub workbooks).
the subworkbooks are setup so that when they are saved they also copy certain values out to another 'backup' file.
So there are 2 possible routes that the files will be used in:

1) SubWorkbook opened directly
- User opens SubWorkbook and makes some changes.
- User closes the SubWorkbook saving changes, or clicks the save button. The BeforeSave event opens the "restore" workbook, copies over the key values from the subworkbook, then saves & closes the "restore" workbook.

2) SubWorkbook opened remotely
- User / Admin opens the "Summary" workbook and changes an option.
- The summary workbook opens a subworkbook and makes changes, then saves it. The subworkbook should (as before), then open the restore workbook and save the key values etc.

The problem is in the second scenario the 'restore' workbook doesn't get opened.

I have created a set of 3 workbooks to illustrate the problem here.
Book1.xls = Summary workbook
Book2.xls = Subworkbook
Book3.xls = Restore workbook.

If you open book2 and then save it the 'BeforeSave' event will cause it to open book3 and write the output of 'Now()' to the next free row of book3-columnA, before then closing and saving book3,......

View 3 Replies View Related

Open Workbook / Copy / Close Without Offer To Save?

Mar 12, 2014

I've got a kind of "menu" sheet that will pull up various reports from Excel spreadsheets. Rather than having the user work with the live data, the menu opens the file and saves it as a copy, closing the original. This is working fine.

The tweak I want to add is, since the user is looking at a copy rather than the live data, I don't want them to save when closing. Is it possible to programatically add a bit of code to the new copy to handle this?

Here's a sample of one of the menu button's code:

Code:

Private Sub CommandButton18_Click()
Dim wb As Workbook
Set wb = Workbooks.Open(Filename:="J:Z PII OvensRack Repair TrackingRack Repair List.xlsx")
With wb.Worksheets("Sheet1")
.Unprotect Password:="pass"
ActiveWorkbook.Worksheets("Sheet1").Copy
End With

[Code].....

View 7 Replies View Related

Open ANY File Type From Excel, Save And Close

Aug 16, 2008

I need to open about 2000 documents one at a time, and save them with a different name.

they are a mix of word documents, PDFs and .jpg pictures.

some VBA like:


Open.file strPath & nextfile
where strpath = C:Temp

and nextfile = picture01.jpg

What should the line be? or is it more complex than a single line ?

View 9 Replies View Related

Open Workbook, Find Last Row & Paste, Save And Close

Jun 13, 2008

What i need to do is Open a Closed workbook (which i have done in the code below)

1 . When this book opens there is a msgbox that needs to have "template" pasted in to then ok automatically clicked ( i have no clue if this can even be done)

2. Then go to Sheet("contactor info") find last row then paste certain info. Below is a peice of code i have from the open workbook but of corse it doesnt work. The red is where it hangs up.

openpath = ActiveWorkbook.Path & ""
Set wb = Workbooks.Open(openpath & "Template.xls")
With wb.Sheets("Contractor Info")
. Cells(Sheets("Contractor info").Rows.Count, "B").End(xlUp)(2, 1).Select
ActiveCell.Value = Msg1
ActiveCell.Offset(0, 4).Value = Msg2
ActiveCell.Offset(0, 5).Value = Msg3
ActiveCell.Offset(0, 3).Value = Msg5
ActiveCell.Offset(0, 2).Value = Msg4
ActiveCell.Offset(0, 1).Value = Msg6
ActiveCell.Offset(0, 6).Value = Msg7
Application.Calculation = xlCalculationManual..................

View 2 Replies View Related

Excel 2007 :: Make Button In Ribbon Menus To Run Macro?

Aug 9, 2013

I've been trying to research how to do this for a while now and still can't figure it out. My impression is that this is fairly straightforward in Excel 2010 since the menus and ribbons are easily customizable but not so in Excel 2007.

So far I can get macro shown as a button in the Quick Access Toolbar. But the issue is that I can't organize them or customize the icons.

Is there an accepted practice for this?

View 4 Replies View Related

Open / Refresh Connections To ODBC - Recalculate One Sheet / Save And Close

Mar 25, 2014

I am using Task scheduler to open a workbook which has some connections to an ODBC that are set to refresh on opening.

I need to automate:-

One of the sheets needs to recalculate for the sort by ascending code to run on the sheet.

Save and then close after say 2 minutes of opening (to give the ODBC connections enough time to finish).

View 2 Replies View Related

Excel 2007 :: VBA To Save And Close All Open Workbooks Except Macro Workbook?

Mar 8, 2013

I have a macro that opens all workbooks from one directory and runs a macro for each workbook to clean up the data. I cannot figure out how to take all those open workbooks and save them to another directory and close the workbook. Also, I do not want the macro workbook (xlsm) to save. I only want it to close. I am working in 2007 Excel.

View 8 Replies View Related

ActiveX Combobox - Linked Cell Reference Lost After Save / Close And Re-open Workbook

Feb 11, 2013

Using the developer tab I inserted an Active X combo box. Under properties I referenced a 'linked cell' that I want the data to appear in. This box works great as long as I keep the sheet open. Once I save and close the workbook and re-open, that reference is lost. It shows #REF! in that field. Why does it lose the reference? I have tried to reference a cell on the same sheet as well as a cell in a different sheet and it keeps the sheet name but not the individual cell.

View 13 Replies View Related

Excel 2010 :: Can't Save Custom Table Style Format So That It Is Available Next Time When Open Workbook

Jun 10, 2013

I'm a fan of the Excel 2010 table styles, but can't figure one thing out. When I create a table in excel (Ctrl+T), I like to reformat it with a new defined style. When I save the style, I can use it while I'm in that instance of excel, but when I close and reopen excel, the style is gone. How to save the custom formats to they are always available?

View 3 Replies View Related

How To Add To Custom Ribbon Tab That Is Built As Add-in

Nov 8, 2012

I am looking for the settings if possible that will add to a custom tab in the ribbon.

What I have is an add-in that creates a custom tab in the excel ribbon. I save it as an add-in and activate it in excel options so it is available for all workbooks.

Now I have a callback in there that runs a macro that opens a workbook, this workbook also has custom UI that I want additional callbacks added to the same custom tab created in the add-in.

Is this possible?

View 2 Replies View Related

Custom Context Menus For Any WB (using Add-in?)

Jan 12, 2010

Ok, so I have this neat little macro that on right-click brings up a custom context menu that displays a few different options - for example one such function is simply copying the selected cell content to a (specific) different sheet. It is a very useful feature in the context I am normally using it to merge information from different locations in a new structure (well, I think this is irrelevant, but just letting you know basically what I am doing).

Anyhow, to implement the custom context menu, I am using events in the ThisWorkbook object, namely Activate to add context menu entries and DeActivate to remove them if switching workbook.

Now, if I receive any workbook from someone else, I'd like to add this feature to get the custom context menu easily without having to copy the received workbook into a new workbook (it's a bit of a hassle, and ideally, if the received workbook has any other macros, this function could just be merged). I was thinking using an add-in to achieve this, but using the ThisWorkbook events in the add-in doesn't trigger the events (I guess because the hidden workbook in the add-in is never "Activated" or "DeActivated").

View 6 Replies View Related

Custom Menus Available To One Workbook

Sep 24, 2008

There was an article in ozgrid new about excel custom toolbars (<<hover over). The article addressed making the custom menu option available in one workbook with Private Sub Worksheet modules as follows

Private Sub Worksheet_Activate()
Application.CommandBars("Worksheet Menu Bar").Controls _
("My Menu").Enabled = True
End Sub

Private Sub Worksheet_Deactivate()
Application.CommandBars("Worksheet Menu Bar").Controls _
("My Menu").Enabled = False
End Sub

How do you get the first module to run apon opening the workbook and the second module to run when you close the workbook.

View 7 Replies View Related

Create Custom Menus

Apr 19, 2007

I was reviewing the "Create Custom Menu Items in Excel VBA" code located at [url] and cannot figure out something. How do I add a menu dropdown that contains MORE than one submenu item? This is the code my question pertains to: ...

View 9 Replies View Related

Custom Ribbon Button To Load Add-In?

Aug 8, 2013

I have a pretty developed add-in I've created for use at work. It has 3 full custom ribbon tabs worth of buttons and boxes and other features that run all of the macros in the project. Everyone loves it. The only problem is, its only used when we work with customer statement excel files. When using Excel for other tasks it is annoying to have 3 extra, essentially useless tabs taking up space on the ribbon.

Is it possible to create a button and stick it on, say the Data tab, that will "Start" the add-in and make the 3 custom tabs visible? Ideally there would also be a button to "Close" the add-in or hide the extra tabs until they're needed as well, but how to customize for my specific needs.

View 1 Replies View Related

Custom Menus 2000 Vs 2007

Feb 6, 2009

We are currently on Office 2000, but our IT group are considering a company wide switch to 2007. I've played around with it just briefly, but noticed that it is night and day difference in both look and feel.

We use Hyperion Essbase, and have a custome built planning tool that utilizes Excel 2000, enhaced with a few thousand lines of VBA coding. One of the main purposes of the VBA code, is to control the Excel menus and replace with custom built menus that are specific to our Planning System.

Does anyone have any idea if VBA controlled custom menus from Excel 2000 will even work in 2007? Will I have to do complete rewrite?

One last question, If you are running 2007, is there a transition function (simlar) to prior versions, where you make the menus look like the legacy version?

View 10 Replies View Related

Sharing Custom Menus & Their Macros

Aug 26, 2008

Our ERP system generates reports in CSV. I have created a custom excel menu, which houses a lot of buttons that launch various macros to format these reports. I have been asked to share these formatting macros with other users.

I understand that the custom menu structures are stored in an excel11.xlb file. My thought was to simply replace the users *.xlb file. This only half worked. I get the menus and the macros, but when the users try to run the macros from the menu excel can't find them because the path is pointing to my user name.

View 3 Replies View Related

Add Custom Menus To Single Workbook Only

Apr 3, 2008

Using example code from Adding Custom Menus, I now have functional menu items that call my macros appropriately. The example also contains code to add or remove a menu conditional on its window being active. What I need is a slight variant on this but not quite obvious to my novice brain.

The add and remove menu code is now stored in my personal.xls file. However, I need that the condition check that a key string be present in the name of the active window, not the file where the macro is stored.

Thus, if the front window is of the file named MyData, then the special menus get added (the conditional string is "MyData"). If the window is named YourData, the special menus get removed. Note, neither of these two files contain any macros.

View 4 Replies View Related

Create Custom Menus For Specific File

Sep 14, 2007

I tried to create a custom menu for a specific file. However, after creating the menu, I posted the file in Sharepoint. When a user download the file from the sharepoint site, the custom menu doesn't work because it is looking for the macro links from my computer. Another problem is that now the custom menu shows up in all other excel files that I open.

My questions are:
1. How do I do it so that the custom menu shows up only when this file is opened up.
2. How do I go about making the menu to look for the macros embeded in the file itself instead of looking for it in my file folder.

View 9 Replies View Related

Excel 2010 :: How To Assign RELATIVE Macros To Custom Ribbon

Aug 19, 2014

I currently have an excel workbook (2010) in which I created a custom ribbon and assigned several different macros to the buttons.

Long story short, I will be saving several variations of this workbook every so often when I get new data.

The problem is that if I change the name of the file (Save as or Rename), the custom ribbon buttons no longer work. When I assigned the macros to the ribbon buttons, the macros were absolutely assigned.

Is it possible to assign relative macros to custom ribbons?

From research I have done, it appears that custom ribbons cannot be created using VBA. Is this still true?

View 6 Replies View Related

Excel 2007 :: Custom Controls Not Showing In Add-ins Ribbon Tab And XML Error

Jul 18, 2013

We are using Windows7 with Excel 2007. We have old code from excel 2003 and earlier that was adding a msoControlPopup with other sub-controls using the code below:

Code:
Set HelpMenu = CommandBars(1).FindControl(Id:=30010)
If HelpMenu Is Nothing Then
' Add the menu to the end

[Code].....

I tried going to Excel Options>Customize>Reset to reset any customizations to the quick access toolbar as this was recommended by something else I found online. This did not fix the problem.

I can find the control in the Immediate window but it just isn't showing in the add-ins tab. if I can find and repair that XML file perhaps?

View 9 Replies View Related

Code, That Disables Save, Save As And Close Commands

Nov 2, 2009

Each of the worksheets in my model use A1 as a control cell for any errors and inconsistencies. My aim is to disable save and close commands in case A1 is not equal to 0 in any of the worksheets.

The code I currently use for that purpose is as follows.

View 2 Replies View Related

Excel 2010 :: Save Open Worksheet To File And Include Date Of Save?

Mar 11, 2014

am using Excel 2010 and having issues trying to save a worksheet to a specified file location with the save date....

I have tried several posts form this forum and elsewhere and can't seem to get the macro to do what I want.....

I want to save a 'worksheet' from an open workbook that I use for updating information to the same file path as the workbook with the date the file saved...

View 6 Replies View Related

Customize Look In/Save In (My Places) In Open/Save As Dialog Boxes

May 10, 2008

I would like to add some icons on the left side of excel open file pane to faciliate my work. Because i need to load some files under the same folder many times a day. Does anybody know how to do that? I've seen people has more icons on the pane before. The defaut setting has only 'History', 'My Documents', 'Favorites', 'Desktop' and ' My nutwork places' on it.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved