Application.CutCopyMode = False intellisense doesn't show this option

taurean

Well-known Member
Joined
Jun 17, 2011
Messages
2,190
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Sometimes, I wonder why this particular option is not shown by intellisense though valid. Macro recorder also picks it fine.

It shows the other two which I have seldom put explicitly xlCut and xlCopy!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I believe the reason is that CutCopyMode is written as a Long Integer property; using xlCutCopyMode Enumeration.
Boolean's can still be passed but will be treated as Long Integers (True=-1; False=0)

You can test this by creating a dummy property. I've wacked this in the ThisWorkbook module.
Code:
Private mxlCutCopy As XlCutCopyMode

Public Property Get CutCopyExample() As XlCutCopyMode
    CutCopyExample = mxlCutCopy
End Property

Public Property Let CutCopyExample(ByVal xlCutCopy As XlCutCopyMode)
    mxlCutCopy = xlCutCopy
End Property

Sub test()
    Me.CutCopyExample = False
    Debug.Print Me.CutCopyExample
End Sub

So if you play around with it you will see that intellisense only offers xlCut and xlCopy because those are the only two values in the xlCutCopyMode enumeration. But if you test True/False you will see -1/0 respectively written out to the immediate window.
 
Last edited:
Upvote 0
Yes that sure seems to be the case. But shouldn't it be shown by intellisense? It is minor annoyance.
 
Upvote 0
The point I make is that it can't be shown because of the enumeration. Unless they were to add xlTrue (-1) and xlFalse(0) to the enumeration.
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,797
Members
449,337
Latest member
BBV123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top