Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active cell causes runtime error when running macro

Status
Not open for further replies.

ninjamyst

Programmer
Jan 28, 2005
21
US
Whenever a cell is active in edit mode (when user enter a cell with the blinking '|' ), running any macro that contain excel application method calls causes a runtime error "1004: method 'SomeMethod' of object 'excel application' failed" . However, when I go to debug mode, and just continue execution, everything works fine. It seems like Excel is busy waiting for the user to finish editing the cell and I can't make it do anything. Any advice?
 
Is there any way to detect when Excel enters cell editing mode? The worksheet Change event fires AFTER a cell has been changed. There are no events that fires as soon as excel enters cell editing mode. So far I can catch the doubleclick event and know that cell editng will take place. However, users can also just start typing at a selected cell. This 'flaw' in Excel is really frustrating...
 
Hi ninjamyst,

What are you trying to achieve here? Why do you want to be running code while the user is entering data in a cell?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Actually, I don't want to be running any code while Excel is in Edit Mode. I am trying to prevent that from happening. That's why I want to know when Excel is in Edit Mode so I make sure none of my code will run.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top