Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VSTO and Excel--End Cell Edit Mode?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default VSTO and Excel--End Cell Edit Mode?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VSTO and Excel--End Cell Edit Mode?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default VSTO and Excel--End Cell Edit Mode?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VSTO and Excel--End Cell Edit Mode?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default VSTO and Excel--End Cell Edit Mode?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007-starts in cell edit mode dalec Excel Discussion (Misc queries) 0 August 1st 07 11:14 PM
Is it possible to arrow to a different cell while in edit mode? Latka2k Excel Discussion (Misc queries) 1 December 9th 05 09:51 PM
VBA command for edit cell mode quartz[_2_] Excel Programming 2 April 15th 05 02:57 PM
cell value in edit mode with COM addin Julian Tucker Excel Programming 0 September 7th 04 11:51 AM
Detecting Cell Edit Mode Marc[_15_] Excel Programming 1 December 3rd 03 11:09 PM


All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"