Bug 170439 - Implement VBA Application.CutCopyMode property support
Summary: Implement VBA Application.CutCopyMode property support
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
26.8.0.0 alpha0+ master
Hardware: All All
: medium enhancement
Assignee: Devansh Varshney
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-22 17:06 UTC by Devansh Varshney
Modified: 2026-01-22 17:06 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Devansh Varshney 2026-01-22 17:06:12 UTC
Description:
While investigating the regression (tdf#169110) where VBA macros failed 
with Basic runtime error '423' Property or method not found: CutCopyMode, 
I confirmed that this property is currently a stub in the LibreOffice 
VBA compatibility layer.

Existing code in sc/source/ui/vba/vbaapplication.cxx

uno::Any SAL_CALL
ScVbaApplication::getCutCopyMode()
{
    //# FIXME TODO, implementation
    uno::Any result;
    result <<= false;
    return result;
}

void SAL_CALL
ScVbaApplication::setCutCopyMode( const uno::Any& /* _cutcopymode */ )
{
    //# FIXME TODO, implementation
}


Existing code in ScVbaApplication::getCutCopyMode and setCutCopyMode 
contains // FIXME TODO comments and simply returns False or does nothing.

This causes compatibility issues with Excel macros that 
rely on this property to check clipboard state or clear the 
selection marquee.


The plan for this enhancement is to implement the properties 
to align with MS Excel behavior.


Additional Info:
VBA reference
https://learn.microsoft.com/en-us/office/vba/api/excel.application.cutcopymode




Actual Results:
When accessing Application.CutCopyMode in a VBA macro, 
it currently always returns False (0), even if cells 
have been copied or cut.


Expected Results:
Application.CutCopyMode should return xlCopy (1) or xlCut (2) 
if there is active data on the clipboard.

Setting Application.CutCopyMode = False should clear the 
clipboard and remove the selection frame, consistent with 
Excel behavior.


Reproducible: Always


User Profile Reset: No

Additional Info:

Version: 26.8.0.0.alpha0+ (AARCH64)
Build ID: 07c1453cd2cbcf6447b0bb1a6107c9f63b8d1429
CPU threads: 10; OS: macOS 26.2; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded