Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Cutcopymode problem

Thanks for any help on following:

What I'm trying to do is to paste something as a text to an area which
format is "@". As I don't know its size I paste it, then change the
format of selection (pasted area) to "@" and paste it again. This works
fine when data in clipboard is not from Excel, if it is this doesnt
work.

I noticed that cutcopymode is always 0 when the data in clipboard is
not from Excel. If it is the cutcopymode is 1 until there's this line
in the code:

selection.numberformat = "@"

after this cutcopymode is always changing to 0.

I don't have it.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cutcopymode problem

That is because the Selection.Numberformat = "@" clears the clipboard for a
copied range.

--
Regards,
Tom Ogilvy


"Roman" wrote in message
oups.com...
Thanks for any help on following:

What I'm trying to do is to paste something as a text to an area which
format is "@". As I don't know its size I paste it, then change the
format of selection (pasted area) to "@" and paste it again. This works
fine when data in clipboard is not from Excel, if it is this doesnt
work.

I noticed that cutcopymode is always 0 when the data in clipboard is
not from Excel. If it is the cutcopymode is 1 until there's this line
in the code:

selection.numberformat = "@"

after this cutcopymode is always changing to 0.

I don't have it.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Cutcopymode problem

Thanks for explanation.
Why doesn't this happen when I put data into clipboard in another
application?
Do you know the purpose of that? I find it quite strange.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cutcopymode problem

I don't know if I can say why. Why questions might need to be answered by
the developers of excel.

--
Regards,
Tom Ogilvy

"Roman" wrote in message
oups.com...
Thanks for explanation.
Why doesn't this happen when I put data into clipboard in another
application?
Do you know the purpose of that? I find it quite strange.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Cutcopymode problem

That's true, thanks for your time anyway.
I'm sorry for silly questions but probably there are some of them still
waiting on my VB learning path...



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default Cutcopymode problem

Roman,

The following can be observed about Excel:

- When selecting a range and copying it to the clipboard excel will try
to remember the range. When you then paste again INTO excel, excel will
use that range agian. You can see this by doing a cut, this willl not
clear the range in excel until you did a paste, and if the paste is in
another app, it will never clear the range! Remembering the copied
range is essential, but Excel can only remember it as long as you do
not do any destructive action.
A destructive action is: allmost all GUI actions including editing of
cells, but not selecting cells. Also through VBA touching format
functions or clearing cells.

As soon as you do this excel will lose its copied range(the dashed line
vanishes) and it will clear the clipboard!

Note that this strange behavior can be traced back to Excel's XLM
roots. A lot of VBA functions are (in a sense) using XLM macro's which
where the programming tool of Excel 5 and earlier. Some of those macro
comands (ie action commands) E.g. the XLM FORMAT(CELL) macro command
or the "SELECT" macro comman show this behavior. I suspect these
"commands" are actually the real culprits. So I suspect all VBA
comands using XLM give you this behaviour. Intersetingly enough VBA
Select(ion) was wisely enough implemented another way, so most of those
actions will not clear the clipboad. This goes for other VBA commands
as well, but some commands still show the strange behaviors of the XLM
forefathers.

Why XLM is implemenetd this way I would not know since I do not have
much exp with that. I suspect XLM could not distinguish between a
selection and a clipboard selection(i.e. just one type of selection
available).

DM Unseen

PS some code I used for testing (to show I'm not just blabbering;)

Range("A1:D9").ClearContents
Application.ExecuteExcel4Macro("SELECT(""$A$9"","" !$A$9"")")
Application.ExecuteExcel4Macro("FORMAT.NUMBER(""@" ")")
Application.ExecuteExcel4Macro "SELECT(""!$C$3:$E$5"", ""!$C$5"")"
Application.ExecuteExcel4Macro "SELECT(, ""R[10]C[5]"")"

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Cutcopymode problem

DM,
thanks for your experiences. They are valued to me.
(Never suspected you of blabbering!)
Good day!

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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
CutCopyMode question gootroots Excel Discussion (Misc queries) 1 December 14th 09 01:13 PM
CutCopyMode=False does not work Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 4 September 19th 08 05:32 PM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM
CutCopyMode = False Michael Smith Excel Programming 5 May 7th 04 05:33 PM


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