_Worksheet.PasteSpecial Method

Pastes the contents of the Clipboard onto the sheet using a specified format. Use this method to paste data from other applications or to paste data in a specific format.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Sub PasteSpecial ( _
    Format As Object, _
    Link As Object, _
    DisplayAsIcon As Object, _
    IconFileName As Object, _
    IconIndex As Object, _
    IconLabel As Object, _
    NoHTMLFormatting As Object _
)
'Usage
Dim instance As _Worksheet
Dim Format As Object
Dim Link As Object
Dim DisplayAsIcon As Object
Dim IconFileName As Object
Dim IconIndex As Object
Dim IconLabel As Object
Dim NoHTMLFormatting As Object

instance.PasteSpecial(Format, Link, DisplayAsIcon, _
    IconFileName, IconIndex, IconLabel, _
    NoHTMLFormatting)
void PasteSpecial(
    Object Format,
    Object Link,
    Object DisplayAsIcon,
    Object IconFileName,
    Object IconIndex,
    Object IconLabel,
    Object NoHTMLFormatting
)

Parameters

  • Format
    Type: System.Object

    Optional Object. A string that specifies the Clipboard format of the data.

  • Link
    Type: System.Object

    Optional Object. True to establish a link to the source of the pasted data. If the source data isn’t suitable for linking or the source application doesn't support linking, this parameter is ignored. The default value is False.

  • DisplayAsIcon
    Type: System.Object

    Optional Object. True to display the pasted data as an icon. The default value is False.

  • IconFileName
    Type: System.Object

    Optional Object. The name of the file that contains the icon to use if DisplayAsIcon is True.

  • IconIndex
    Type: System.Object

    Optional Object. The index number of the icon within the icon file.

  • IconLabel
    Type: System.Object

    Optional Object. The text label of the icon.

  • NoHTMLFormatting
    Type: System.Object

    Optional Object. True to remove all formatting, hyperlinks, and images from HTML. False to paste HTML as is. The default value is False.

Remarks

NoHTMLFormatting will only matter when Format = “HTML”. In all other cases, NoHTMLFormatting will be ignored.

You must select the destination range before you use this method.

This method may modify the sheet selection, depending on the contents of the Clipboard.

See Also

Reference

_Worksheet Interface

_Worksheet Members

Microsoft.Office.Interop.Excel Namespace