5 Replies Latest reply: Jan 18, 2013 12:03 PM by Phaneendra Kunche RSS

    Hide "Send to Excel" if Limit Exceeds

    Phaneendra Kunche



      I am looking for a way to hide the "Send to Excel" & "Export..." in the properties of an object, when user Right Clicks on it.


      Basic need is to contol the user not to export more than 600K rows of data. i can get that info using a macro or an Aggr on Dimensions on the chart.


      so if the chart rows crosses that limit either i have to hide those menu options or popup an warning not to export.


      Does any one have an Idea  on how we can control these menu options?






        • Re: Hide "Send to Excel" if Limit Exceeds

          Hi Phani,


          You can use something like this within a macro:


          set mybox = ActiveDocument.GetSheetObject("CH01")

          mbp = mybox.GetProperties

          mbp.Layout.Frame.XLIcon = true

          mybox.SetProperties mbp


          That code lets you show or hide the "Send to Excel" icon of an object. I think that might help you.



            • Re: Hide "Send to Excel" if Limit Exceeds
              Phaneendra Kunche

              Thanks for your time.


              Code you provided will work awesome to hide the XL icon on the title of the charts, that i already know from the API guide.

              But i need to know a way to hide the options that are shown in below image.



              I have attached the example QVW that i am trying to get this done.

              • Re: Hide "Send to Excel" if Limit Exceeds
                Rebecca Molstad

                Even if you hide the icon to Send to Excel, the user will still be able to right click and select 'Send to Excel' unless you disable the option in the Document Properties.  One solution may be to just add in a warning message that the export is not advised.


                If you don't like that option, maybe see about adding a macro to change the document properties to disable Exporting when your limit is surpassed and re-enable it when the user is back under the row limit. I haven't tried that before though so I don't know if that is easy or even possible.  Somebody like swuehl or Gysbert Wassenaar would probably be able to tell you.  See attached for example of first option. Note that I only used Count(Volume) to calculate rows since the sample data is so simplified; your equation would probably be a far more complex aggr() expression.