xml - Control Name for Insert tab -


i trying design workbook restrictions without using vba in excel, compatible in 2007 , 2010. have chosen "custom ui editor microsoft office" xml code restrict few options:- save-as info tab, insert, delete, move/copy sheet, hide sheet, unhide sheets. successful in doing have noticed insert sheet tab "icon"

enter image description here

is still working , accessible. can point me control name disable through xml in file please?

my code is:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?> <customui xmlns="http://schemas.microsoft.com/office/2009/07/customui">   <commands>                <command idmso="filesaveaswebpage" enabled="false" />                <command idmso="filesaveas" enabled="false" />                <command idmso="filesaveasmenu" enabled="false" />                <command idmso="filesaveasexcelxlsx" enabled="false" />                <command idmso="filesaveasexcelxlsxmacro" enabled="false" />                <command idmso="filesaveasexcel97_2003" enabled="false" />                <command idmso="filesaveasexcelopendocumentspreadsheet" enabled="false" />                <command idmso="filesaveaspdforxps" enabled="false" />                <command idmso="filesaveasotherformats" enabled="false" />                 <command idmso="sheetinsert" enabled="false" />                <command idmso="sheetinsertpage" enabled="false" />                <command idmso="sheetdelete" enabled="false" />                <command idmso="sheetrename" enabled="false" />                <command idmso="sheetmoveorcopy" enabled="false" />                <command idmso="sheetunhide" enabled="false" />                <command idmso="sheetprotect" enabled="false" />                <command idmso="sheettabcolorgallery" enabled="false" />                 <command idmso="sheettabcolormorecolorsdialog" enabled="false" />              <command idmso="selectallsheets" enabled="false" />   </commands>   <backstage>            <tab idmso="tabinfo" visible="false"/>   </backstage> </customui> 

i have tried searching microsoft , rondebruin office fluent user interface control identifiers also.

for done through xml need able access element - needs have id. manually scanning through various lists microsoft published turned nothing helpful, since documentation notoriously sloppy decided write small piece of code finds id of "every control id" in excel application, , lists it:

sub listid() dim r range dim ctls dim ii long  cells(1, 1).value = "id" cells(1, 2).value = "caption" cells(1, 3) = "type" set r = range("a1")  ii = 1 100000   set ctls = commandbars.findcontrol(id:=ii)   if not (ctls nothing)   'debug.print "controls id " & ii & " exists; caption " & ctls.caption & "; type " & ctls.type   set r = r.offset(1, 0)   r.value = ii   r.offset(0, 1) = ctls.caption   r.offset(0, 2) = ctls.type   r.offset(0, 3) = ctls.tooltiptext   end if next ii  end sub 

after run this, , filter on eet in name, expect see controls "that can controlled" (because have msoid) , relate "sheets". following snapshot of produces:

enter image description here

when hover mouse on "button" want hide, tooltip "insert sheet" - isn't of ones can see in list. conclude indeed impossible asking - cannot disable button xml.

that doesn't mean can't achieve like. suggest following approaches.

  1. trap workbook event triggered when new sheet created, , delete on spot. when button "stops working" people give up. example code below.
  2. hide sheet tabs completely, , provide alternative method of navigating between sheets. since "controlled spreadsheet" may idea anyway. either create custom tab on ribbon (using xml, seem familiar that), or create floating toolbar lives @ bottom of sheet - close "old" tabs used be. in way simulate behavior - it's lot of work , bit of hack
  3. add protection workbook. use protection -> protect workbook -> "protect structure": sheets can not moved, deleted, hidden, unhidden, or renamed. new sheets cannot inserted.

the code have add thisworkbook is:

private sub workbook_newsheet(byval sh object)   dim temp boolean   temp = application.displayalerts   application.displayalerts = false   sh.delete   application.displayalerts = temp end sub 

once in workbook, time user clicks "new sheet" button there brief flash, no new sheet created. add application.screenupdating = false brief flash remains...

sorry don't have better news you.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -