Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Paste special function in macros fail if we disable application cellDrap Drop

Hi,
I have an excel which has a inhouse format. When a user tires to
paste data onto to the excel he should only be pasting values and not
disturb the format / formulas in the excel.I have implemented this by
using paste special when the user tries to paste.This can be done by
capturing the paste keys and calling paste special instead.
In addition to this I also need to diable the Cell Drag drop
functionality so that no one should be able to drag the cells down and
disturb the formulas.So I used the Application.CellDragDrop = false.
This does throws error when paste special is called saying the paste
special function of the range failed.If I comment the
Application.CellDragDrop = false line it works fine.I have given the
code below. Any help appreciated.
Private Sub Workbook_Activate()
Application.CellDragAndDrop = false
Application.OnKey "^v", "Sheet1.Pastewithoutformatting" 'Added new
function
End Sub
Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = true
End Sub

Sub PasteWithoutFormatting()
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlPasteSpecialOperationNone, SkipBlanks:=False,
Transpose:=False
Exit Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default Paste special function in macros fail if we disable application cell Drap Drop

I don't think there is any way that the D&D setting affects Paste Special.
So I'd check for something else being the problem - not being in Copy mode,
selection (paste selection) not being compatible with the range being
copied, sheet protection,...

Odd that your "false" and "true" below are not capitalized.

--
Jim
wrote in message
...
| Hi,
| I have an excel which has a inhouse format. When a user tires to
| paste data onto to the excel he should only be pasting values and not
| disturb the format / formulas in the excel.I have implemented this by
| using paste special when the user tries to paste.This can be done by
| capturing the paste keys and calling paste special instead.
| In addition to this I also need to diable the Cell Drag drop
| functionality so that no one should be able to drag the cells down and
| disturb the formulas.So I used the Application.CellDragDrop = false.
| This does throws error when paste special is called saying the paste
| special function of the range failed.If I comment the
| Application.CellDragDrop = false line it works fine.I have given the
| code below. Any help appreciated.
| Private Sub Workbook_Activate()
| Application.CellDragAndDrop = false
| Application.OnKey "^v", "Sheet1.Pastewithoutformatting" 'Added new
| function
| End Sub
| Private Sub Workbook_Deactivate()
| Application.CellDragAndDrop = true
| End Sub
|
| Sub PasteWithoutFormatting()
| Selection.PasteSpecial Paste:=xlPasteValues,
| Operation:=xlPasteSpecialOperationNone, SkipBlanks:=False,
| Transpose:=False
| Exit Sub
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Paste special function in macros fail if we disable applicationcell Drap Drop

On Jan 22, 9:42*am, "Jim Rech" wrote:
I don't think there is any way that the D&D setting affects Paste Special.
So I'd check for something else being the problem - not being in Copy mode,
selection (paste selection) not being compatible with the range being
copied, sheet protection,...

Odd that your "false" and "true" below are not capitalized.

--
wrote in message

...
| Hi,
| * I have an excel which has a inhouse format. When a user tires to
| paste data onto to the excel he should only be pasting values and not
| disturb the format / formulas in the excel.I have implemented this by
| using paste special when the user tries to paste.This can be done by
| capturing the paste keys and calling paste special instead.
| In addition to this I also need to diable the Cell Drag drop
| functionality so that no one should be able to drag the cells down and
| disturb the formulas.So I used the Application.CellDragDrop = false.
| This does throws error when paste special is called saying the paste
| special function of the range failed.If I comment the
| Application.CellDragDrop = false line it works fine.I have given the
| code below. Any help appreciated.
| Private Sub Workbook_Activate()
| Application.CellDragAndDrop = false
| Application.OnKey "^v", "Sheet1.Pastewithoutformatting" 'Added new
| function
| End Sub
| Private Sub Workbook_Deactivate()
| Application.CellDragAndDrop = true
| End Sub
|
| Sub PasteWithoutFormatting()
| * *Selection.PasteSpecial Paste:=xlPasteValues,
| Operation:=xlPasteSpecialOperationNone, *SkipBlanks:=False,
| Transpose:=False
| * *Exit Sub
|


Ya I was of the same opinion that the D &D should not have any impact
over pastespecial.but the funny thing is the paste special works
absolutely fine if I remove / comment the D & D code. i.,e I comment
Application.CellDragAndDrop = True
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
To give paste special (value) in macros pol Excel Discussion (Misc queries) 1 July 27th 09 05:02 PM
Cause workbook to fail to open if user opts to disable macros I Believe Excel Programming 10 July 5th 07 09:50 PM
Disable paste special attributes Hippy Excel Programming 1 December 31st 05 06:24 PM
Disable Paste Special Steph[_3_] Excel Programming 2 June 29th 05 06:13 PM
Disable the Edit menu command 'Paste Special' George Raymond Excel Programming 4 December 22nd 03 04:44 AM


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