https://bugs.documentfoundation.org/show_bug.cgi?id=170439

            Bug ID: 170439
           Summary: Implement VBA Application.CutCopyMode property support
           Product: LibreOffice
           Version: 26.8.0.0 alpha0+ master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to