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

 public sealed class CopyPasteProperties
Public NotInheritable Class CopyPasteProperties

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.


          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);
        

          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)
        

Name

Description

CopyColumnWidth

CopyComments

CopyFormatting

CopyFormulas

CopyMergedCells

CopyRowHeight

CopyValues

Name

Description

CopyPasteType