Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Application.DisplayFormulaBar Kills CutCopyMode

Hi all,
I have a friend with workbook that he needs to distribute and doesn't want
to have the formula bar visible to users.
When using Application.DisplayFormulaBar = False/True when switching between
sheets or workbooks, the CutCopyMode is deactivated.

Is there any way preserve the CutCopymode while doing other Events within
the Excel app?

Thanks for any replies,
Ed.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Application.DisplayFormulaBar Kills CutCopyMode

Lots (most) macros will kill the clipboard. I don't think there's a good way to
save it.

But maybe you could kill your macro if there's something in it.

something like:

If Application.CutCopyMode < False Then
Exit Sub
End If
Application.DisplayFormulaBar = False



Ed Adamthwaite wrote:

Hi all,
I have a friend with workbook that he needs to distribute and doesn't want
to have the formula bar visible to users.
When using Application.DisplayFormulaBar = False/True when switching between
sheets or workbooks, the CutCopyMode is deactivated.

Is there any way preserve the CutCopymode while doing other Events within
the Excel app?

Thanks for any replies,
Ed.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Application.DisplayFormulaBar Kills CutCopyMode

Further to Dave, I always try to delay the copy until all events that kill
copy mode are run.

Another approach is to copy directly to the clipboard, bypassing the Excel
copy mechanism. But since this does not copy formats you lose some utility.
Also it copies formulas literally, rather than relatively as Excel does.

Sub CopyData()
Dim MyData As DataObject
Dim StrBuf As String, SrcRg As Range
Dim CurrRow As Range, CurrCell As Range
'Build a long string of cell contents (formulas)
' Tabs separate columns
' Carriage returns separate rows
Set SrcRg = Selection
For Each CurrRow In SrcRg.Rows
For Each CurrCell In CurrRow.Cells
StrBuf = StrBuf & CurrCell.Formula & Chr(9)
Next
'Remove last Tab on row and add carriage return
StrBuf = Left(StrBuf, Len(StrBuf) - 1) & Chr(13)
Next
On Error Resume Next
Set MyData = New DataObject
MyData.SetText StrBuf
MyData.PutInClipboard
End Sub


--
Jim
"Ed Adamthwaite" wrote in message
...
| Hi all,
| I have a friend with workbook that he needs to distribute and doesn't want
| to have the formula bar visible to users.
| When using Application.DisplayFormulaBar = False/True when switching
between
| sheets or workbooks, the CutCopyMode is deactivated.
|
| Is there any way preserve the CutCopymode while doing other Events within
| the Excel app?
|
| Thanks for any replies,
| Ed.
|
|


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
CutCopyMode question gootroots Excel Discussion (Misc queries) 1 December 14th 09 01:13 PM
Cutcopymode problem Roman[_4_] Excel Programming 6 June 24th 05 12:02 PM
CutCopyMode = False Michael Smith Excel Programming 5 May 7th 04 05:33 PM
Ctrl-v doesn't work after changing Application.DisplayFormulaBar Lee Drage Excel Programming 1 January 7th 04 02:47 AM
DisplayFormulaBar = True Silverio Excel Programming 2 September 17th 03 10:47 PM


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