Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Solution: How to programmaticaly leave "edit mode"

There have been many posts looking for a way to programmatically exit
Excel's edit mode. After almost a year of periodically trying I believe the
following to work on both Excel 2000 & 2003. Your mileage may vary.

The solution is based on Excel's current behavior of committing the open
edit before closing the document. Excel will also allow the integrated code
{mine is a COM addin}to cancel a close.

In a nutshell, to close an open edit, call close on the ActiveWorkbook and
set cancel to VARIANT_TRUE in an onClose handler.

It's not pretty, but it seems less fragile than sending keys {which I for
one never got to work}.

thoughts? reactions? improvements?
cheers,
dave


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Solution: How to programmaticaly leave "edit mode"

David,

I'm confused. How do you call the procedure while you are editing a cell?
Can you give an example of when you would run this and how it would work?

Doug

"David Owens" wrote in message
...
There have been many posts looking for a way to programmatically exit
Excel's edit mode. After almost a year of periodically trying I believe

the
following to work on both Excel 2000 & 2003. Your mileage may vary.

The solution is based on Excel's current behavior of committing the open
edit before closing the document. Excel will also allow the integrated

code
{mine is a COM addin}to cancel a close.

In a nutshell, to close an open edit, call close on the ActiveWorkbook and
set cancel to VARIANT_TRUE in an onClose handler.

It's not pretty, but it seems less fragile than sending keys {which I for
one never got to work}.

thoughts? reactions? improvements?
cheers,
dave




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Solution: How to programmaticaly leave "edit mode"

He is having code manipulate Excel. The problem is that if the user is in
edit mode when the code runs, the code fails. There is no way to chekc if
the user is in edit mode, so this way, the code can force the user out of
edit mode so the code can then do its very important work.

--
Regards,
Tom Ogilvy

"Doug Glancy" wrote in message
...
David,

I'm confused. How do you call the procedure while you are editing a cell?
Can you give an example of when you would run this and how it would work?

Doug

"David Owens" wrote in message
...
There have been many posts looking for a way to programmatically exit
Excel's edit mode. After almost a year of periodically trying I believe

the
following to work on both Excel 2000 & 2003. Your mileage may vary.

The solution is based on Excel's current behavior of committing the open
edit before closing the document. Excel will also allow the integrated

code
{mine is a COM addin}to cancel a close.

In a nutshell, to close an open edit, call close on the ActiveWorkbook

and
set cancel to VARIANT_TRUE in an onClose handler.

It's not pretty, but it seems less fragile than sending keys {which I

for
one never got to work}.

thoughts? reactions? improvements?
cheers,
dave






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
why do i "sometimes" need to "edit chart object" before "source da Flirty and Blonde Charts and Charting in Excel 1 February 2nd 10 02:07 PM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
Solution "Your changes could not be saved" "The document may be read-only or encrypted" [email protected] Excel Discussion (Misc queries) 0 August 7th 06 06:31 AM
Make "Edit" mode default, rather than "Enter"? Greg Boettcher Excel Discussion (Misc queries) 1 July 27th 06 01:46 AM
How do I get "file" tab to click on, it starts with "edit" JMD_Phoenix Excel Discussion (Misc queries) 1 January 23rd 06 02:46 AM


All times are GMT +1. The time now is 08:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"