Disable "Refresh" in Excel 2007

Add-in Express™ Support Service
That's what is more important than anything else

Disable "Refresh" in Excel 2007
 
nir zamir


Guest


Hi,

I'm trying to disable the "Refresh" button in Excel 2007, which appears (for example) in the "Connections" tab in the "Data" ribbon.
(in Excel 2003 I disabled the "Refresh Data" button using ExcelApp.CommandBars.FindControls()).

Our company already purchased the Add-in Express 2007, but we haven't upgraded our project yet, so I'm still working with version 2.7.1762.

How can this button be disabled? I haven't found it using "BuiltInControlsScanner" (does it identify all controls of Excel 2007 too?).
Is it possible that this button is impossible to disable with the ADX version I have?

Thank you,
Nir
Posted 06 Mar, 2007 02:52:51 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nir.

It is not possible with Add-in Express v2.8. Please use the latest version of our software. The Ribbon IU can't be accessed via the Excel Object Model. That is why the 'Built-In Controls Scanner' tool doesn't work in the Ribbon UI. To disable controls in the Ribbon UI you can use the Ribbon components of the Add-in Express 2007 product.


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found
Posted 06 Mar, 2007 08:41:15 Top
Jeremy P




Posts: 13
Joined: 2007-01-30
Would it be possible to post a bit of code illustrating this? I'm also having trouble switching over from the commandbar.
Posted 06 Mar, 2007 15:45:07 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nir and Jeremy.

I have just tested disabling of the "Refresh Data" button. Excel doesn't allow us to disable this button but you can hide the built-in group called 'Connections' and re-create it again with controls that you need. Please look at the follwing example:
http://www.add-in-express.com/projects/hiderefreshbutton.zip
Posted 06 Mar, 2007 16:32:04 Top
Jeremy P




Posts: 13
Joined: 2007-01-30
I didn't notice any code in there about manipulating the buttons. It looked like a default project template.

Are different office 2007 buttons easier to enable/disable than others?
For instance what about the little save button on the title bar or "Print" in the office dropdown.
Posted 06 Mar, 2007 17:00:43 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Jeremy.

I didn't notice any code in there about manipulating the buttons. It looked like a default project template.

In Add-in Express v3.x all is done at the design time.


For instance what about the little save button on the title bar or "Print" in the office dropdown.

No problem.
Posted 07 Mar, 2007 06:50:28 Top
Jeremy P




Posts: 13
Joined: 2007-01-30
Ok, I see it now.

Thanks Sergey
Posted 07 Mar, 2007 10:26:06 Top
nir zamir


Guest


Hi Sergey,

few comments/questions:

1. How do you change any other button inside an Excel ribbon? Do buttons still have an ID that can be searched for?
2. What do you mean by "Excel doesn't allow us"? Does it ignore the property? Can it help if we contact Microsoft for help?
3. The solution you've suggested doesn't make the button disappear from all places in Excel, e.g. quick access bar, Pivot Table options ribbon tab etc.

Thanks,
Nir
Posted 08 Mar, 2007 04:53:03 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Nir,

1. All Ribbon controls have its own IDMso. You can't change built-in controls in the Ribbon UI. You can only add your own controls or customize built-in tabs/groups. Please read about the Ribbon UI here:
http://www.microsoft.com/downloads/details.aspx?familyid=4329D9E9-4D11-46A5-898D-23E4F331E9AE&displaylang=en
http://msdn2.microsoft.com/en-us/library/aa338198.aspx
2. I meant that some Ribbon controls ignores your attempts to change its state. You can ask Microsoft about this issue but I don't think it will help much.
3. The Ribbon UI is extensive and mysterious but we must live with it.
Posted 08 Mar, 2007 15:04:06 Top