Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I'm not sure about the terminology, but my situation is that a user is in the middle of editing the contents of a cell and then clicks on a toolbar button, and interacts with a custom form - causing the program to either write the "open" cell (the cell currently being edited) or create a new sheet in the workbook. In either case the operation throws an exception. Is there a command that I can use to tell excel to end the user edit? That way I can end the edit prior to running any of my custom forms and thus avoid the problem - rather than handling exceptions everywhere. Thanks in advance Dave |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No ideas from anyone? Really? Not even help with the language? What do you
call the state of the system when the user is in the middle of editing a cell? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I call it edit mode.
Jan Karel Pieterse posted this. I think it should work in xl2003 and below. I'm not sure what you'd check in xl2007's ribbon. When XL is in editing mode, certain menu items are disabled. You could check for the enabled property of them. E.g.: Sub Editing() If Application.CommandBars(1).FindControl(ID:=23, _ recursive:=True).Enabled = False Then MsgBox "Editing" Else MsgBox "Not editing" End If End Sub ========= Maybe you can check that status before your code does anything. lahd wrote: No ideas from anyone? Really? Not even help with the language? What do you call the state of the system when the user is in the middle of editing a cell? -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do you run that macro when you're in edit mode, Dave? Aren't macros
disabled then? The only way I recall "achieving" that was with a Windows API callback ontime function. I think it crashed Excel<g. -- Jim "Dave Peterson" wrote in message ... |I call it edit mode. | | Jan Karel Pieterse posted this. I think it should work in xl2003 and below. | I'm not sure what you'd check in xl2007's ribbon. | | | When XL is in editing mode, certain menu items are disabled. You could check for | the enabled property of them. | | E.g.: | | Sub Editing() | If Application.CommandBars(1).FindControl(ID:=23, _ | recursive:=True).Enabled = False Then | MsgBox "Editing" | Else | MsgBox "Not editing" | End If | End Sub | | | ========= | Maybe you can check that status before your code does anything. | | | | lahd wrote: | | No ideas from anyone? Really? Not even help with the language? What do you | call the state of the system when the user is in the middle of editing a cell? | | -- | | Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, I've got a toolbar (which happens to be a VSTO add-in) and I can start
editing a cell then click on a toolbar button. Thanks for the answer Dave "Jim Rech" wrote: How do you run that macro when you're in edit mode, Dave? Aren't macros disabled then? The only way I recall "achieving" that was with a Windows API callback ontime function. I think it crashed Excel<g. -- Jim "Dave Peterson" wrote in message ... |I call it edit mode. | | Jan Karel Pieterse posted this. I think it should work in xl2003 and below. | I'm not sure what you'd check in xl2007's ribbon. | | | When XL is in editing mode, certain menu items are disabled. You could check for | the enabled property of them. | | E.g.: | | Sub Editing() | If Application.CommandBars(1).FindControl(ID:=23, _ | recursive:=True).Enabled = False Then | MsgBox "Editing" | Else | MsgBox "Not editing" | End If | End Sub | | | ========= | Maybe you can check that status before your code does anything. | | | | lahd wrote: | | No ideas from anyone? Really? Not even help with the language? What do you | call the state of the system when the user is in the middle of editing a cell? | | -- | | Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I never have.
So I'm glad lhad answered! Jim Rech wrote: How do you run that macro when you're in edit mode, Dave? Aren't macros disabled then? The only way I recall "achieving" that was with a Windows API callback ontime function. I think it crashed Excel<g. -- Jim "Dave Peterson" wrote in message ... |I call it edit mode. | | Jan Karel Pieterse posted this. I think it should work in xl2003 and below. | I'm not sure what you'd check in xl2007's ribbon. | | | When XL is in editing mode, certain menu items are disabled. You could check for | the enabled property of them. | | E.g.: | | Sub Editing() | If Application.CommandBars(1).FindControl(ID:=23, _ | recursive:=True).Enabled = False Then | MsgBox "Editing" | Else | MsgBox "Not editing" | End If | End Sub | | | ========= | Maybe you can check that status before your code does anything. | | | | lahd wrote: | | No ideas from anyone? Really? Not even help with the language? What do you | call the state of the system when the user is in the middle of editing a cell? | | -- | | Dave Peterson -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or lahd.
Sorry. Dave Peterson wrote: I never have. So I'm glad lhad answered! Jim Rech wrote: How do you run that macro when you're in edit mode, Dave? Aren't macros disabled then? The only way I recall "achieving" that was with a Windows API callback ontime function. I think it crashed Excel<g. -- Jim "Dave Peterson" wrote in message ... |I call it edit mode. | | Jan Karel Pieterse posted this. I think it should work in xl2003 and below. | I'm not sure what you'd check in xl2007's ribbon. | | | When XL is in editing mode, certain menu items are disabled. You could check for | the enabled property of them. | | E.g.: | | Sub Editing() | If Application.CommandBars(1).FindControl(ID:=23, _ | recursive:=True).Enabled = False Then | MsgBox "Editing" | Else | MsgBox "Not editing" | End If | End Sub | | | ========= | Maybe you can check that status before your code does anything. | | | | lahd wrote: | | No ideas from anyone? Really? Not even help with the language? What do you | call the state of the system when the user is in the middle of editing a cell? | | -- | | Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Runs when the user changes any cell on the work sheet | Excel Programming | |||
Changing linked cell runs ComboBox code | Excel Programming | |||
How to access the text selection when user is editing cell | Excel Programming | |||
Code that ask user for a password before it runs.. | Excel Programming | |||
Show progress in a user form while code runs | Excel Programming |