Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

The CopyPasteProperties object represents the types of data that will be copied from a worksheet when you call the CopyPaste() method.

Signature
C#
C#
 public sealed class CopyPasteProperties
Signature
vb.net
vb.net
Public NotInheritable Class CopyPasteProperties
Remarks

You can use the CopyPasteType enumeration to specify the type of data that will be copied. If you set CopyPasteType to None, then you must set individual properties on the CopyPasteProperties object before calling the CopyPaste() method.

To create a CopyPasteProperties object, call the CreateCopyPasteProperties() method on a Workbook object.

Example
Code Block
csharp
csharp
titleC#

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          CopyPasteProperties properties =
               wb.CreateCopyPasteProperties(CopyPasteProperties.CopyPasteType.All);
          Area areaToCopy = wb.Worksheets[0].CreateArea(0, 0, 3, 3);
          Worksheet ws = wb.Worksheets[0];
          ws.CopyPaste(0, 0, areaToCopy, properties);
        
Code Block
vb.net
vb.net
titlevb.net

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Create()
          Dim properties As CopyPasteProperties = _
               wb.CreateCopyPasteProperties(CopyPasteProperties.CopyPasteType.All)
          Dim areaToCopy as Area = wb.Worksheets(0).CreateArea(0, 0, 3, 3)
          Dim ws as Worksheet = wb.Worksheets(0)
          ws.CopyPaste(0, 0, areaToCopy, properties)
        
Properties

Name

Description

CopyColumnWidth

Excerpt Include
CopyPasteProperties.CopyColumnWidth
CopyPasteProperties.CopyColumnWidth
nopaneltrue

CopyComments

Excerpt Include
CopyPasteProperties.CopyComments
CopyPasteProperties.CopyComments
nopaneltrue

CopyFormatting

Excerpt Include
CopyPasteProperties.CopyFormatting
CopyPasteProperties.CopyFormatting
nopaneltrue

CopyFormulas

Excerpt Include
CopyPasteProperties.CopyFormulas
CopyPasteProperties.CopyFormulas
nopaneltrue

CopyMergedCells

Excerpt Include
CopyPasteProperties.CopyMergedCells
CopyPasteProperties.CopyMergedCells
nopaneltrue

CopyRowHeight

Excerpt Include
CopyPasteProperties.CopyRowHeight
CopyPasteProperties.CopyRowHeight
nopaneltrue

CopyValues

Excerpt Include
CopyPasteProperties.CopyValues
CopyPasteProperties.CopyValues
nopaneltrue
Classes

Name

Description

CopyPasteType

Excerpt Include
CopyPasteProperties.CopyPasteType
CopyPasteProperties.CopyPasteType
nopaneltrue