How do I detect cell mode?

  • Thread starter Thread starter Andrej.Gaevskij
  • Start date Start date
A

Andrej.Gaevskij

I am looking for any advice as to how to detect cell mode. How to I
detect that cell in edit mode?
 
You should be able to check the status of the menu item in your c# code.
 
Not something I have used, but you can check and see if checking the ready
property of the application object will indicate this:

Sub UseReady()

If Application.Ready = True Then
MsgBox "Application is ready."
Else
MsgBox "Application is not ready."
End If

End Sub

However in one thread someone said it returned true regardless of the state
of edit mode. The Ready property is in xl2002 and later. \

this is vba code to check the state of the Open menu item if you want to try
and to it in C#.

Dim C As Office.CommandBarControl
Set C = Application.CommandBars.FindControl(ID:=23) ' Open
button
If C.Enabled = True Then
Debug.Print Now, "Not Edit Mode"
Else
Debug.Print Now, "Edit Mode"
End If
 
Tom said:
Not something I have used, but you can check and see if checking the ready
property of the application object will indicate this:

Sub UseReady()

If Application.Ready = True Then
MsgBox "Application is ready."
Else
MsgBox "Application is not ready."
End If

End Sub

However in one thread someone said it returned true regardless of the state
of edit mode. The Ready property is in xl2002 and later. \

this is vba code to check the state of the Open menu item if you want to try
and to it in C#.

Dim C As Office.CommandBarControl
Set C = Application.CommandBars.FindControl(ID:=23) ' Open
button
If C.Enabled = True Then
Debug.Print Now, "Not Edit Mode"
Else
Debug.Print Now, "Edit Mode"
End If

Thanks, Tom! Great solution of my problem!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top