Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default user editing cell when code runs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default user editing cell when code runs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default user editing cell when code runs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default user editing cell when code runs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default user editing cell when code runs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default user editing cell when code runs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default user editing cell when code runs

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
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
Macro Runs when the user changes any cell on the work sheet raphiel2063 Excel Programming 4 September 5th 07 01:40 PM
Changing linked cell runs ComboBox code hmm Excel Programming 1 August 21st 07 02:15 PM
How to access the text selection when user is editing cell Buergermeister Excel Programming 5 May 5th 06 02:47 PM
Code that ask user for a password before it runs.. KimberlyC Excel Programming 10 July 14th 05 12:45 AM
Show progress in a user form while code runs Bura Tino Excel Programming 2 April 15th 04 06:18 AM


All times are GMT +1. The time now is 10:40 AM.

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"