VincentSteenvoorden

Hi,

When an Excel sheet is in Edit mode Some RibbonUI's are grayed out. I want the same behavior for my CustomUI. How can I detect that the sheet is in Edit Mode .



Re: Visual Studio Tools for Office Graying out CustomUI

Dennis Wallentin

Hi,

Does this refer to a VSTO project or is it just a specific Ribbon X question

If the later then I suggest that You post here:

http://pschmid.net/office2007/forums/index.php






Re: Visual Studio Tools for Office Graying out CustomUI

Mike Walker

Hi

What do you mean by Edit mode, the basic RibbonUI has a GetEnabled Callback that is used to fireback to you a question on whether a control is Enabled or not. If you add this to your XML definition and then you can use the Object Model to do some checking to return the appropriate answer.

Regards






Re: Visual Studio Tools for Office Graying out CustomUI

VincentSteenvoorden

Hi,

I think both, I am working on an Excel 2007 VSTO project. Within this project I have customized the RibbonX. In this CustomUI I added some buttons which have all the GetEnabled attribute.

When the sheetSeletionChange event occure in my ExceI sheet 2007 document I can toggle these buttons, so the GetEnabled calback works, but this is not exactly what I want.

I noticed that the standard Excel buttons (like Conditional Formating button etc) in the RibbonX turned gray when the user enters the Formula Bar in the Excel sheet or the same happens when the user enters some value in an Excel cell. The state of the Excelsheet (at the bottom of the sheet) turns form ready to edit or the enter state. So I thought there is something like Edit mode or edit state condition in an Excel sheet.

This bahavior, turn gray (which is disabled) I also want for my CustumUI. So I am looking for a something like the sheetChangeState event or a sheetIsInEditState condition to toggle my GetEnabled callback action.

with regards

Vincent

PS English is not my native language so I appoligize for my english, but I appreciate your effort to answer my question.






Re: Visual Studio Tools for Office Graying out CustomUI

VincentSteenvoorden

Hi Mike,

Thats the point, I am looking for specific checking. I am looking for the event when an user enters the formula bar or enters an Excel cell.

This is what I mean by Edit mode: The moment an user enters the formula bar, the standard ribbonX buttons turned gray and at the bottom of the excel document the text "Ready" turns to "Edit" or "Enter".

So I am looking for that Event.

with regard

Vincent






Re: Visual Studio Tools for Office Graying out CustomUI

Mike Walker

This is the problem with Excel and Events in that the mode you are looking for is possibly the Change event on The worksheet. The main issue is RibbonX will fire the GetEnabled Callback that you will have to try and validate whether the status is "In Edit" you cant otherwise get this from what I am looking at in the OM

Regards






Re: Visual Studio Tools for Office Graying out CustomUI

VincentSteenvoorden

Hi Mike,

I have looked in the OM, I tried a number of events on apllication and workbook level, it seems that there is no such event. May be I have overlooked an event or I have to search in another level.

I think that what I am looking for is internal event in Excel and not visisble for me.

Thanx for your effort.

regards

Vincent






Re: Visual Studio Tools for Office Graying out CustomUI

Dennis Wallentin

Vincent,


I am looking for the event when an user enters the formula bar or enters an Excel cell.

When Excel is in 'Edit mode' it's not possible to execute any code. As for detecting when Excel is in 'Edit mode' it would require a more advanced approach where we still can't get any code to be executed. All in all, it's a 'turn around station'.