Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to programmatically end edit mode in a cell if a user has
edited a cell's contents, but has not exited edit mode before triggering code in my OfficeCodeBehind class? Since the cell is still in edit mode, my code-behind is not able to see the new value in the cell. Thanks -- Jim Tilson MCP |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Since the cell is still in edit mode, my code-behind is not able to see
the new value in the cell. But this no new value until the user presses Enter. I know of no way to find what is in the Formula Bar in Edit mode. I don't use VSTO but in normal VBA no events are triggered and no code can run in Edit mode. Is it different via VSTO? -- Jim "Jim Tilson" wrote in message ... | Is there a way to programmatically end edit mode in a cell if a user has | edited a cell's contents, but has not exited edit mode before triggering code | in my OfficeCodeBehind class? Since the cell is still in edit mode, my | code-behind is not able to see the new value in the cell. | | Thanks | | -- | Jim Tilson | MCP |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Right--What I need to be able to do is to commit any outstanding changes in
the cell so that the value is available to my code behind. For example, I have a menu I added to the Excel toolbar to perform a handful of functions. One of those functions is to save the spreadsheet data to a database. If the user begins to edit a cell, then *while the cell is in edit mode* clicks the menu and chooses the "Save to Database" command, I need a way to end edit mode to make that new value available to my code so that the new value can be saved to the database. -- Jim Tilson MCP "Jim Rech" wrote: Since the cell is still in edit mode, my code-behind is not able to see the new value in the cell. But this no new value until the user presses Enter. I know of no way to find what is in the Formula Bar in Edit mode. I don't use VSTO but in normal VBA no events are triggered and no code can run in Edit mode. Is it different via VSTO? -- Jim "Jim Tilson" wrote in message ... | Is there a way to programmatically end edit mode in a cell if a user has | edited a cell's contents, but has not exited edit mode before triggering code | in my OfficeCodeBehind class? Since the cell is still in edit mode, my | code-behind is not able to see the new value in the cell. | | Thanks | | -- | Jim Tilson | MCP |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
In Edit Mode, the Excel messge will enter a loop(similar as a modal dialog,msgbox), so most of menu and button will be grey out. Based on my test, it will work in the Save Button. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox Application.ActiveCell.AddressLocal Debug.Print "Save" Cells(1, 1).Select End Sub I think you may try to do the similar job in your own button click. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It did not work. The cell is still in edit mode.
Your event handler code below is for the Workbook BeforeSave event. I'm talking about my own event handler to save the spreadsheet data to the database--I'm not running through the WorkBook's file save event. -- Jim Tilson MCP ""Peter Huang" [MSFT]" wrote: Hi In Edit Mode, the Excel messge will enter a loop(similar as a modal dialog,msgbox), so most of menu and button will be grey out. Based on my test, it will work in the Save Button. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox Application.ActiveCell.AddressLocal Debug.Print "Save" Cells(1, 1).Select End Sub I think you may try to do the similar job in your own button click. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Sorry for confusion, as I said before, when the cell in edit mode, the message loop is similar with a modal dialog, most of the message will not work. So far do further research to see if there is any other way to do the job with a button_click of our customized button. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007-starts in cell edit mode | Excel Discussion (Misc queries) | |||
Is it possible to arrow to a different cell while in edit mode? | Excel Discussion (Misc queries) | |||
VBA command for edit cell mode | Excel Programming | |||
cell value in edit mode with COM addin | Excel Programming | |||
Detecting Cell Edit Mode | Excel Programming |