View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Timo Timo is offline
external usenet poster
 
Posts: 20
Default Excel cell editing mode

Application.Interactive caused immediately some kind of error. Ready didn't
work either. Perhaps your way is the best. Only thing left to try is checking
if the FileNew menu is enabled. How can I do it ?


"NickHK" wrote:

There is Application.Interactive that may be suitable then. But I still say
you should only run your code when not in Edit Mode.

NickHK

"timo" wrote in message
...
In this case forcing user out of the Edit Mode would not be a big deal
because this software is made to very specific purpose only. Users of this
one would typically write only short comments about values of got from

serial
port. Software only write in 2 columns, sample number and value of sample.

I
was thinking if it was possible to switch off Edit Mode, I would switch it
off, do the transfer and switch it back to on. Off time would be very

short
it wouldn't be any problem.


"NickHK" wrote:

Many people seem to attempt this, but to me your code should check if

Excel
is in a suitable state to respond before you attempt to write to a cell,
i.e. check if Excel is in Edit Mode.
There was a suggestion from MS that you can check the Application.Ready
property.
However, it is not available on XL2000 and below. Also, some reply that

it
does not really work.

Another suggestion was to see if the FileNew menu was enabled or not.

It is a very bad idea to force the user out of Edit Mode, as they may

have
spent a long time entering a complex formula, only to lose everything
because you want to put a value in a cell.

NickHK

"timo" wrote in message
...
I'm developing software which transfers data from serialport to Excel
sheet.
The problem is software crashing while cursor is in cell and data is
written
to cell. In this project user MUST be able to modify/write cells
sometimes.
This is what I'm gettin: Call was rejected by callee exception from
HRESULT
0x8001001(rpc_e_call_rejected).
Is it possible to switch off cell editing mode while cursor is in cell

?
I'm
talking about similar effect with pressing enter while cursor is in

cell.
I'm using VB 2005 & Excel 2003.