Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.sdk
external usenet poster
 
Posts: 13
Default Exit from Excel edit mode using IDispatch

Exit from Excel edit mode using IDispatch

I've searched Internet and groups, but can't find a solution to this.
Can anyone, please, tell, is there any way to perform exit from Excel
edit mode in programmatic way with either accepting user input or
cancelling it. I need to do that from another application using the
IDispatch pointer to Excel. Here is another trick comes out: I can get
the pointer to the active instance of Excel. I can even determine if
is it in edit mode (just call the function to activate my ole object
of excel and I get the E_OUTOFMEMORY error. That is understandable).
So when I detect, that excel is in Edit mode, is there any way to tell
excel to exit that mode? Any ideas? Thanks for any help.

  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.sdk
external usenet poster
 
Posts: 17
Default Exit from Excel edit mode using IDispatch

It sounds like you need to call the following:

IOleInplaceObject::InPlaceDeactivate()
IOleObject::Close()
IUnknown::Realease()

In order to fully exit and close the Excel process. It has been years
since I did anything like that though!

HTH,

Colby

  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.sdk
external usenet poster
 
Posts: 13
Default Exit from Excel edit mode using IDispatch

Thanks, however the problem is a bit different.

User opens some file and starts editing the cell, thus putting excel
into the edit mode. Then I launch my application that works with excel
ole object. And I can't activate that object, bacause of an error.
I've ivestigated that issue and found out, that this is because excel
is in the edit mode. So, I basically need to tell excel to exit that
mode. If its possible :)

On Nov 13, 10:34 pm, Colby Africa wrote:
It sounds like you need to call the following:

IOleInplaceObject::InPlaceDeactivate()
IOleObject::Close()
IUnknown::Realease()

In order to fully exit and close theExcelprocess. It has been years
since I did anything like that though!

HTH,

Colby



  #4   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.sdk
external usenet poster
 
Posts: 7
Default Exit from Excel edit mode using IDispatch

Hello,

Excel provides the Application.Interactive property. Try (and catch) to set
it to false. If the exception fires, you cannot do anything because the edit
mode is on.

Regards from Belarus,

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com


"Goofball" wrote in message
ups.com...
Thanks, however the problem is a bit different.

User opens some file and starts editing the cell, thus putting excel
into the edit mode. Then I launch my application that works with excel
ole object. And I can't activate that object, bacause of an error.
I've ivestigated that issue and found out, that this is because excel
is in the edit mode. So, I basically need to tell excel to exit that
mode. If its possible :)

On Nov 13, 10:34 pm, Colby Africa wrote:
It sounds like you need to call the following:

IOleInplaceObject::InPlaceDeactivate()
IOleObject::Close()
IUnknown::Realease()

In order to fully exit and close theExcelprocess. It has been years
since I did anything like that though!

HTH,

Colby





  #5   Report Post  
Posted to microsoft.public.excel.misc, microsoft.public.excel.programming,microsoft.public.excel, microsoft.public.excel.sdk
external usenet poster
 
Posts: 13
Default Exit from Excel edit mode using IDispatch

Thanks. That's one more way to find out if edit mode is on. The
question is still open: is there a way to turn it off?...

On Nov 14, 7:21 pm, "Andrei Smolin [Add-in Express]" <andrei dot
smolin @ add-in-express dot_com wrote:
Hello,

Excel provides the Application.Interactive property. Try (and catch) to set
it to false. If the exception fires, you cannot do anything because the edit
mode is on.

Regards from Belarus,

Andrei Smolin
Add-in Express Team Leaderwww.add-in-express.com

"Goofball" wrote in message

ups.com...

Thanks, however the problem is a bit different.


User opens some file and starts editing the cell, thus putting excel
into the edit mode. Then I launch my application that works with excel
ole object. And I can't activate that object, bacause of an error.
I've ivestigated that issue and found out, that this is because excel
is in the edit mode. So, I basically need to tell excel to exit that
mode. If its possible :)


On Nov 13, 10:34 pm, Colby Africa wrote:
It sounds like you need to call the following:


IOleInplaceObject::InPlaceDeactivate()
IOleObject::Close()
IUnknown::Realease()


In order to fully exit and close theExcelprocess. It has been years
since I did anything like that though!


HTH,


Colby




  #6   Report Post  
Posted to microsoft.public.excel.misc, microsoft.public.excel.programming,microsoft.public.excel, microsoft.public.excel.sdk
external usenet poster
 
Posts: 17
Default Exit from Excel edit mode using IDispatch

Have you tried to set focus to another control on the application that
is hosting Excel?


  #7   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.sdk
external usenet poster
 
Posts: 7
Default Exit from Excel edit mode using IDispatch

If this is possible, I'd rather not take upon me the responsibility for
saving changes made by
the user.

Regards from Belarus,

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com

"Goofball" wrote in message
...
Thanks. That's one more way to find out if edit mode is on. The
question is still open: is there a way to turn it off?...

On Nov 14, 7:21 pm, "Andrei Smolin [Add-in Express]" <andrei dot
smolin @ add-in-express dot_com wrote:
Hello,

Excel provides the Application.Interactive property. Try (and catch) to
set
it to false. If the exception fires, you cannot do anything because the
edit
mode is on.

Regards from Belarus,

Andrei Smolin
Add-in Express Team Leaderwww.add-in-express.com

"Goofball" wrote in message

ups.com...

Thanks, however the problem is a bit different.


User opens some file and starts editing the cell, thus putting excel
into the edit mode. Then I launch my application that works with excel
ole object. And I can't activate that object, bacause of an error.
I've ivestigated that issue and found out, that this is because excel
is in the edit mode. So, I basically need to tell excel to exit that
mode. If its possible :)


On Nov 13, 10:34 pm, Colby Africa wrote:
It sounds like you need to call the following:


IOleInplaceObject::InPlaceDeactivate()
IOleObject::Close()
IUnknown::Realease()


In order to fully exit and close theExcelprocess. It has been years
since I did anything like that though!


HTH,


Colby




  #8   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.sdk
external usenet poster
 
Posts: 9
Default Exit from Excel edit mode using IDispatch

This probably is a horrible way to approach the problem, from a style point
of view, but would sending the Excel application either an ESC (would clear
edit and other user-interaction modes) or ENTER (would accept user input or
execute a paste operation, etc.) keystroke via the Win32 API work for you?
The latter might carry risks that are unacceptable, the user getting things
copied over existing cells, for example.


"Goofball" wrote in message
ups.com...
Exit from Excel edit mode using IDispatch

I've searched Internet and groups, but can't find a solution to this.
Can anyone, please, tell, is there any way to perform exit from Excel
edit mode in programmatic way with either accepting user input or
cancelling it. I need to do that from another application using the
IDispatch pointer to Excel. Here is another trick comes out: I can get
the pointer to the active instance of Excel. I can even determine if
is it in edit mode (just call the function to activate my ole object
of excel and I get the E_OUTOFMEMORY error. That is understandable).
So when I detect, that excel is in Edit mode, is there any way to tell
excel to exit that mode? Any ideas? Thanks for any help.



  #9   Report Post  
Posted to microsoft.public.excel.misc, microsoft.public.excel.programming,microsoft.public.excel, microsoft.public.excel.sdk
external usenet poster
 
Posts: 13
Default Exit from Excel edit mode using IDispatch

Thanks. By now, I've made it such a way, that I ask user to exit the
edit mode and click Retry. Interesting thing: I was sending the Enter
key, but it didn't work if a save dialog was opened and the focus was
on some folder - it just opened that folder in the dialog :) If I send
ESC key, then it exists the save dialog, but looses the changes made
by user. Looks like the only way is to ask the user what he/she want
to do. And another thing: sending keys does not work the same on
different versions of office. Excel 2000 just did nothing...
Well, anyway, thanks you for your help.

On Nov 17, 12:11 pm, "Steve Dalton"
<NOsteveSPAM(at)NOeigensysSPAM(dot)com wrote:
This probably is a horrible way to approach the problem, from a style point
of view, but would sending the Excel application either an ESC (would clear
edit and other user-interaction modes) or ENTER (would accept user input or
execute a paste operation, etc.) keystroke via the Win32 API work for you?
The latter might carry risks that are unacceptable, the user getting things
copied over existing cells, for example.

"Goofball" wrote in message

ups.com...

Exit from Excel edit mode using IDispatch


I've searched Internet and groups, but can't find a solution to this.
Can anyone, please, tell, is there any way to perform exit from Excel
edit mode in programmatic way with either accepting user input or
cancelling it. I need to do that from another application using the
IDispatch pointer to Excel. Here is another trick comes out: I can get
the pointer to the active instance of Excel. I can even determine if
is it in edit mode (just call the function to activate my ole object
of excel and I get the E_OUTOFMEMORY error. That is understandable).
So when I detect, that excel is in Edit mode, is there any way to tell
excel to exit that mode? Any ideas? Thanks for any help.


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
MS Excel 2003: Cant exit design mode, whats the fix? Miker New Users to Excel 0 May 4th 09 11:51 PM
Exit from Excel edit mode using IDispatch Goofball Excel Discussion (Misc queries) 8 November 23rd 07 09:46 AM
How do I exit a cells edit mode? Adam Thwaites Excel Discussion (Misc queries) 6 November 13th 07 07:34 PM
Combo Box goes to edit mode even if design mode is in OFF position Chas Excel Discussion (Misc queries) 0 January 7th 05 07:21 PM
Enter Excel Design Mode and Exit Design Mode Bill Lunney Excel Programming 0 August 4th 03 07:48 AM


All times are GMT +1. The time now is 03:09 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"