Event for RibbonTab click in Excel Addin

Hi,
I am working on an Excel Addin. I am using VS 2008 and Excel 2007.
Currently my addin gets loaded on opening of Excel. Since i have a dropdown in the Ribbon, even that gets loaded on openeing of Excel. And since that loading of dropdown takes time, i wanted to change this behavior. I wanted to load my Addin on click of the
Ribbon Tab. For this i wanted to know how to fire the event on click of Ribbon Tab.
Usually ThisAddIn_Startup() is the method that's fired first when excel is opened. But i want to call this method in the event of Click of Ribbon Tab. Is this possible?
basically i want to capture click event of Ribbon Tab.
Can someone please help me on this.
Regards,
Shailendra

Hi ,
Here's a short sample for you, as Cindy mentioned there's no "click event" for a Ribbon tab, so we need to pick Dropdown list instead.
The idea is when Excel starts we add a button in Dropdown list, if user click the button, then refresh the Dropdown list,fill it with the real data, and also hide the button at same time:
<?xml version="1.0" encoding="UTF-8"?>  
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="Ribbon_Load">  
  <ribbon> 
    <tabs > 
      <tab idMso="TabAddIns"  > 
        <group id="MyGroup"   
               label="My Group">  
          <dropDown id="myDropDown" onAction="dropDownAction" getEnabled="dropDownGetEnabled" getItemLabel="ItemLabel" getItemCount="ItemCount"  > 
            <button id="mybutton" label="Button" onAction ="ReDraw" showImage="false" getVisible="getButtonVisible"/>  
          </dropDown> 
        </group> 
      </tab> 
    </tabs> 
  </ribbon> 
</customUI> 
  bool ButtonVisible = true;  
        int itemCount = 0;  
        public void Ribbon_Load(Office.IRibbonUI ribbonUI)  
            this.ribbon = ribbonUI;  
        public void ReDraw(Office.IRibbonControl RibbonControl)  
            this.ButtonVisible = false;  
            this.itemCount = 9;  
            ribbon.InvalidateControl("myDropDown");  
            ribbon.InvalidateControl("mybutton");  
        public void dropDownAction(Microsoft.Office.Core.IRibbonControl control, string selectedId, int selectedIndex)  
        public bool dropDownGetEnabled(Office.IRibbonControl RibbonControl)  
            return true;  
        public string ItemLabel(Office.IRibbonControl control, int index)  
            return "Item " + index.ToString();  
        public int ItemCount(Office.IRibbonControl control)  
            return this.itemCount;  
        public bool getButtonVisible(Office.IRibbonControl RibbonControl)  
            return this.ButtonVisible;  
For more information about InvalidateControl method :
http://msdn.microsoft.com/en-us/library/aa433553.aspx
Thanks

Similar Messages

  • Using mouse event for right click or scroll

    I would like someone to guide me that if there is any events which can be used for right click of the mouse or the scroll of the mouse(specially the scroll). Until now all the mouse event i have been using is based on the left mouse click, release......  So could anyone guide me how to use the right click and scroll of the mouse using actionscript.
    Thank you!

    You should try searching the forums using the key terms related to what you are after.  I don't think you'll find much help for the right click though... appears to not be supported by Flash.  Below is a link to one result for the mouse scroll from just the other day... you can probably find more if it does not help.
    http://forums.adobe.com/message/3511047#3511047

  • How to create a dialog for use by an Excel AddIn?

    I know the basics of Excel AddIns, but have no idea how to design, implement and later display an internal dialog.
    The "Smart Quote Paste" function below is done, and it does not need any parameters. The function corresponding to the "New Project" button, however, needs to create a number of spreadsheets, provided by the user.
    TIA.

    Hello Travis,
    For example:
    const string message =
    "Are you sure that you would like to close the form?";
    const string caption = "Form Closing";
    var result = MessageBox.Show(message, caption,
    MessageBoxButtons.YesNo,
    MessageBoxIcon.Question);
    // If the no button was pressed ...
    if (result == DialogResult.No)
    // cancel the closure of the form.
    e.Cancel = true;
    If you want to customize it on your own, you can add a new Windows Form to the project and then add the required controls. After creating an instance of the form in the code you may show it using the Show or ShowDialog methods.

  • Opening event for Excel or Word using Web versions of Excel and Word

    Is there an event or other messaging that can be caught and handled when a Word, or Excel file is selected and open using the web version of Word or Excel? At that event I want to access the OOXML file for the selected Word or Excel file and get data from
    it.
    Thanks
    Jim

    Hi Jim,
    As far as I know, Opening event for Excel or Word is not exist in the Javascript API for Office.
    Unfortunately, I could not find such a document.
    >> At that event I want to access the OOXML file for the selected Word or Excel file and get data from it.
    For a workaround, I will recommend you add a function to get the data from the file in the Office.initialize event.​
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • When previewing images by clicking on the thumbnail in an Event for example, I've been finding that many images preview in a 'zoomed in' way so only a small part of the photos is previewed in a highly magnified view.

    When previewing images by clicking on the thumbnail in an Event for example, I've been finding that many images preview in a 'zoomed in' way so only a small part of the photos is previewed in a highly magnified view.
    Initially I could find no cause. Then I tried right click - Edit and on the affected images, always get this warning:
    "Image Cannot Be Edited - This photo was previously edited with another application or with an early version of Iphoto. Duplicate this photo to edit it." and a "Duplicate To Edit" Button is displayed. 
    The external Editor defined for iPhoto is Adobe Photoshop Elements.
    Now, I reckon the MUST be others out there affected by this same apparent Preview bug, yet my searches have not revealed any answers.  Also seems impossible to find a contact number for adobe???
    Thanks

    Start '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Firefox in Safe Mode]''' {web Link} by holding down the '''<Shift ''(Mac Options)'' >''' key, and then starting Firefox. Is the problem still there?

  • How can I export a list of events for one of many calendars - e.g. "sailing" to use in Excel

    How can I export a list of events for one of many calendars - e.g. "sailing" to use in Excel?

    See this thread here
    Display number of emails by sender

  • Click event for single column in DataGrid

    I can add an event listener to a DataGrid of type
    ListEvent.ITEM_CLICK, which is triggered when the user clicks any
    part of an entire row in a DataGrid. I want to trigger a click
    event for just one column. I only want to run a function when the
    user clicks in just the first column of the DataGrid, and not run
    trigger the event if they click in any other column. Any help would
    be much appreciated.

    Accessing the event.target returns the entire DataGrid, not
    the DataGridColum. Any way to get just the DataGrid column?

  • Detect clicked cluster in mouse down event for clusters within multiple stacked clusters

    With the help of Ben (see http://forums.ni.com/t5/LabVIEW/Determine-cluster-element-clicked-in-mouse-down-event/td-p/1245770)
    I could easily find out what sub-cluster had been clicked on (mouse down event) within the main cluster, by using the Label.Text Property.
    However if you have a cluster within a cluster within a cluster then you probably have to use individual mouse down events for each sub-sub cluster.
    I just wanted to use one "Main Cluster":Mouse Down event and from that determine which of the sub-sub clusters had been clicked on - is this even remotely possible?
    Chris.

    Chris Reed wrote:
    With the help of Ben (see http://forums.ni.com/t5/LabVIEW/Determine-cluster-element-clicked-in-mouse-down-event/td-p/1245770)
    I could easily find out what sub-cluster had been clicked on (mouse down event) within the main cluster, by using the Label.Text Property.
    However if you have a cluster within a cluster within a cluster then you probably have to use individual mouse down events for each sub-sub cluster.
    I just wanted to use one "Main Cluster":Mouse Down event and from that determine which of the sub-sub clusters had been clicked on - is this even remotely possible?
    Chris.
    Yes but... you will have to pass through 26 Kudos worth of Nuggets to get there (Well maybe you can skip the last 5 or so).
    This Nugget by Ton teaches us how to use Dynamic Event Registration. (15 Kudos, must read and understand)
    This Nugget by me talks about getting at references inside arbitrary data structures. (11 Kudos, You don't have to read the whole thing, only enough to get at nested objects).
    SO use the stuff I wrote about to gather up the references to the clusters. Build them into an array and then use dynamic event registration and what you learned in that thread you linked in your question.
    So Possible? Yes!
    Easy? YOU tell me.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Retrieve attribute description to Excel Addin for MDS

    I propose a new feature:
    retrieve attribute description to Excel Addin for MDS - as
    separate row, which would be above attribute-row.
    This is especially useful for users - translation into other languages.

    Do you think, it would help if we add description as comments of the column name. So user have to hover the mouse to see it?
    Also, we already have a work item to support multiple language in the model/entity/attribute name. So based on the client OS, it would show different language for the column name. But I cannot promise when we will deliver it at this moment. 

  • Adobe plugin For Mouse Click Event Handler

    Hi All, How to write plugin For Mouse Click Event Handler? Please reply quickly..
    Thanks in Advance

    AS has already been replied to you on the other threads.
    THE ACROBAT SDK has all the information you need to implement your solution. If you investigate the SDK and find a specific part of implementing your solution that is causing a problem. Then post that specific problem on the forum so that Leonard/PDL/ Aandi/Everyone else, can help you with specific problems.
    This question is too open ended for it to be easily answered with out doing a lot of work.
    Please download the SDK.
    Investigate the Documentation/Samples.
    Start developing your plug-in. ( I would recommend the Acrobat-plug-in wizard)
    And if you hit a specific problem we will be happy to try and help.
    Please note MULTIPLE POSTS just annoy.
    HTH
    Malky

  • Office 2003 Excel Addin for Essbase version 5.02

    Is there an Office 2003 Excel addin which will function with Essbase version 5.02? Thanks--cbucklin

    There are no supported addins for Excel 2003 until you get to the Essbase 7.0 or 7.1?) versions of Essbase.Tim TowApplied OLAP, Inc

  • Advanced Analysis for Microsoft Excel - Addin Component does not Appear

    Hy at all, i have this problem:
    i save a workbook on infoview and when i open it , the Addin Advanced Analysis for Microsoft Excel doesn't appear.
    This scenario occurs despite the value "3" on registry of this setting: HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\SBOP.AdvancedAnalysis.Addin.1.
    Thank's.
    Regards.
    Andrea M.

    Hi there,
    I still got the problem under BO 4.0 launchpad.
    Has anyone a solution for that. I use AO 1.2.
    Thanks.
    Regards,
    Heiko

  • Excel Addin for MDS - break the layout of the sheet

    Excel Addin for MDS 2012 / 2014
    When I apply the filter from the server:
    1)  breaks the layout of formatting cells
    2)  if I added my own rows above the row with system attributes and I apply server filter, then my rows are deleted
    These rows should not be deleted !!!
    from Moscow with money

    1)
    after reload entity my format cells  (font, formatting, alignment, back color, ...) disappear.   Why?
    In the end, when I select data from the external sources (MSSQL, Oracle, Analysis Services and other) -
    formatting table cells preserved
    2)
    Yes, I see this message. But.... Why not reload entity without removing my own lines?
    (see screenshot) Pink rows is very useful for users!
    from Moscow with money

  • How to add selection event, change event and click event for dropdownlist for mobile applications

    Please someone help me in writng selection , click and change events for dropdownlist in flex for mobile applications . i have tried but i wasn't able to select the items in dropdown using my mouse or touch in my mobile . Please help me I am struck at this point and i am unable to get solution gfor this. Please................
    Some code for which i neederd help:
    <s:DropDownList id="ddlBranch" x="257" y="475" width="63%" height="80%"
                                    creationComplete="ddlBranch_creationCompleteHandler(event)"
                                    fontFamily="Calibri" fontSize="24"
                                    labelField="BranchName"
                                    prompt="{ddlBranch.selectedItem}"
                                    requireSelection="true"
                                    selectionColor="#7ab342">
                        <s:AsyncListView list="{getBranchResult.lastResult}"/>
                    </s:DropDownList>
    <s:DropDownList id="ddlZone" x="257" y="546" width="63%" height="80%"
                                    creationComplete="ddlZone_creationCompleteHandler(event)"
                                    fontFamily="Calibri" fontSize="24"
                                    labelField="ZoneName"
                                    prompt="{ddlZone.selectedItem}"
                                    requireSelection="true"
                                    selectionColor="#7ab342">
                        <s:AsyncListView list="{getZoneResult.lastResult}"/>
                    </s:DropDownList>
    I will get the list of Branches(first DDL) and Zones(Second DDL) from a webservice written in DOT(.)NET,  what i needded is touch events and selection events for both the dropdown lists and the data in the second DropDown List should bind based on the First Dropdown list item selected.
    Service call for binding data to DDL:
    protected function ddlBranch_creationCompleteHandler(event:FlexEvent):void
                    getBranchResult.token = loginService.getBranch();
                protected function ddlZone_creationCompleteHandler(event:FlexEvent):void
                    getZoneResult.token = loginService.getZone();
    Please help...
    Thank you.

    Therer are two ways you can assign an action to the "OnEnter"-event of your input field:
    1. in method cl_wd_input_field=>new_input_field you have the parameter:
    ON_ENTER
    You just have to assign your action name to this field and it will be called on the OnEnter-event of your InputField.
    e.g:
         lr_input_field = cl_wd_input_field=>new_input_field(
                                                 id = 'INP_MY_INPUT_FIELD'
                                                 on_enter = 'MYACTION'
    2. You can use the method SET_ON_ENTER.
    like:
         lr_input_field->set_on_enter( 'MYACTION' ).
    Just make sure, you have created and implemented this action and its handler.

  • Custom UIView not receiving touch events for fast mouse clicks in simulator

    I'm having a problem in the simulator where if I click fast in a UIView inside a table cell that is setup to receive touch events, it doesn't receive them. But if I click slow (holding down the button for a little bit) the view gets the touch events. I can't test it on the device. Is this a known problem in the simulator?
    Thanks.

    Hi George,
    Thanks a lot for your quick response and jumping to help.
    I am so frustrated that I did not get touch event for the custom cell.
    I also tried your solution for a custom UIImageView, I put the codes of PhotoView.h, PhotoView.m and TestTouchAppDelegate.m here: Please help to look into it for me.
    // PhotoView.h
    // Molinker
    // Created by Victor on 6/18/08.
    // Copyright 2008 _MyCompanyName_. All rights reserved.
    #import <UIKit/UIKit.h>
    @interface PhotoView : UIImageView {
    CGPoint touchPoint1;
    CGPoint touchPoint2;
    @property (nonatomic) CGPoint touchPoint1;
    @property (nonatomic) CGPoint touchPoint2;
    @end
    // PhotoView.m
    // Molinker
    // Created by Victor on 6/18/08.
    // Copyright 2008 _MyCompanyName_. All rights reserved.
    #import "PhotoView.h"
    @implementation PhotoView
    @synthesize touchPoint1;
    @synthesize touchPoint2;
    - (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
    // Initialization code
    self.userInteractionEnabled = YES;
    return self;
    - (void)drawRect:(CGRect)rect {
    // Drawing code
    // Handles the start of a touch
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    UITouch *touch = [touches anyObject];
    touchPoint1 = [touch locationInView:self];
    // Handles the end of a touch event.
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    UITouch *touch = [touches anyObject];
    touchPoint2 = [touch locationInView:self];
    if(touchPoint1.x>touchPoint2.x)
    //move Left
    NSLog(@"Move Left");
    if(touchPoint1.x<touchPoint2.x)
    //move Right
    NSLog(@"Move Right");
    - (void)dealloc {
    [super dealloc];
    @end
    // TestTouchAppDelegate.m
    // TestTouch
    // Created by Victor on 6/17/08.
    // Copyright _MyCompanyName_ 2008. All rights reserved.
    #import "TestTouchAppDelegate.h"
    #import "RootViewController.h"
    #import "PhotoView.h"
    @implementation TestTouchAppDelegate
    @synthesize window;
    @synthesize navigationController;
    - (id)init {
    if (self = [super init]) {
    return self;
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Configure and show the window
    //[window addSubview:[navigationController view]];
    UIImage *myImage= [UIImage imageNamed: @"scene1.jpg"];
    CGRect frame = CGRectMake (0, 20, 300, 400);
    PhotoView *myImageView1 = [[UIImageView alloc ] initWithFrame:frame];
    myImageView1.userInteractionEnabled = YES;
    myImageView1.image = myImage;
    [window addSubview:myImageView1];
    [window makeKeyAndVisible];
    - (void)applicationWillTerminate:(UIApplication *)application {
    // Save data if appropriate
    - (void)dealloc {
    [navigationController release];
    [window release];
    [super dealloc];
    @end
    Message was edited by: Victor Zhang

Maybe you are looking for

  • Want more robust form fields in InDesign for PDF forms.

    I wish that soon InDesign CS6 Interactive Form Fields will include the COMB field for entering data in various formats such as phone numbers, credit card numbers, using some sort of format like [number of characters] ["(nnn) nnn-nnnn"]. I use comb fi

  • Regarding UTL_FILE parameter in the INIT.ORA file

    Dear all, How can i set UTL_FILE parameter in the INIT.ORA file. Also let me know how to create a directory over there.I am new to this area. Where exactly i can locate these details and create directory. Regards, Bala.

  • Unable to call a form from report

    hello i have a drill-down report, from where i wanna to call a transacation level form, so that user can modify the data from that transaction level form after seeing the result from report. After modification in data through form, report should be r

  • Why I can't pass parameters into CR from VB6

    I want to Pass parameters into crystal report from VB6. But whatever I try, it don't work Fine, always Show the message "This field name is not known". Crystal Report:: Parameter: a.@cmpy;                    b.@p1 formula: a. If {?@cmpy} ="USA" or {?

  • Database XE as a server fopr many clients

    Hello, I would like to know if from license point of view, is it possible to use Oracle Databsae XE as a database server for remote clients (copmuters)? My interest is to install Oracle Databse XE in small networks (lets say up to 5 workstations) ins