+ Reply to Thread
Results 1 to 16 of 16

VSTO and Excel--End Cell Edit Mode?

Hybrid View

Guest VSTO and Excel--End Cell Edit... 09-21-2005, 02:05 PM
Guest Re: VSTO and Excel--End Cell... 09-21-2005, 05:05 PM
Guest Re: VSTO and Excel--End Cell... 09-21-2005, 05:05 PM
Guest Re: VSTO and Excel--End Cell... 09-21-2005, 11:05 PM
Guest Re: VSTO and Excel--End Cell... 09-22-2005, 02:05 PM
  1. #1
    Jim Tilson
    Guest

    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. #2
    Jim Rech
    Guest

    Re: 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" <jimtilson@nospam.nospam> wrote in message
    news:E62F62BC-07EE-42B3-A6E2-A84BB25A8BD4@microsoft.com...
    | 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. #3
    Jim Tilson
    Guest

    Re: 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" <jimtilson@nospam.nospam> wrote in message
    > news:E62F62BC-07EE-42B3-A6E2-A84BB25A8BD4@microsoft.com...
    > | 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. #4
    Peter Huang [MSFT]
    Guest

    Re: 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. #5
    Jim Tilson
    Guest

    Re: 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. #6
    Peter Huang [MSFT]
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1