Runtime Error 460: “Invalid Clipboard format,” explained and fixed

Error 460, “Invalid Clipboard format”, fires when Clipboard code asks for data in a format the Clipboard does not currently hold. The Clipboard is multi-format: one copy operation may offer text, rich text, HTML, and an image simultaneously, or only one of them. Code that calls GetText when the Clipboard holds only a picture, or GetData with a format constant the contents do not include, raises error 460. The Clipboard is not broken; the request did not match its contents.

For people who just run the program

  1. Check what you actually copied. Copying from a source that places only an image, or only files, on the Clipboard leaves no text for a paste-as-text tool to read. Copy the text itself and retry.
  2. Copy again, fresh. Clipboard contents are replaced constantly by other actions; a copy made before switching windows may no longer be what the tool receives, especially after copying anything else in between.
  3. Note the source application. Some programs copy in private formats only they understand; a tool expecting standard text or image formats fails on those with this error, and knowing the source explains it.
  4. Report the pairing. “Fails when copying from the browser, works from a document” is a precise and useful report for this error.

For people who write the code

  1. Ask before taking: use GetFormat. The Clipboard object reports which formats are present. Test the format you need and branch, instead of requesting and trapping:
  2. With Clipboard
        .GetFromClipboard  ' (DataObject in VBA hosts)
        If .GetFormat(1) Then          ' 1 = text format available
            s = .GetText(1)
        Else
            MsgBox "The Clipboard does not contain text."
        End If
    End With
  3. Remember the VBA host difference. In Office VBA, Clipboard access goes through the MSForms DataObject, whose GetFormat/GetText mirror the classic Clipboard API. The error and its logic are the same: the format requested is not among the formats offered.
  4. Handle the file-list case. Copying files in Explorer offers a file list format, not text or image. Tools that accept pasted input should detect it and respond appropriately rather than letting a generic GetText raise 460.
Clipboard format constants must match the host's numbering. The standard format values (text = 1 in classic VB's vbCFText) are stable, but custom and registered formats are identified by values assigned at run time. Hard-coding a registered-format number from another session is a quiet route to error 460.

If it still happens

If GetFormat confirms the format and the read still fails, the Clipboard's owner may be slow to render the data (delayed rendering is common with large content from big applications): a brief wait and one retry succeeds where an instant grab failed. Persistent failure with the format present points at the source application, not the reader.

Common questions

Why can the Clipboard hold several formats at once? Because the copying application does not know what will be pasted where. It offers the same content in several formats (text, rich text, image) and the pasting side chooses. Error 460 means the chosen format was not among those offered.

Does error 460 mean the Clipboard is empty? Not necessarily. An empty Clipboard raises it too, but the more common case is a Clipboard full of something else: the requested format is absent while others are present.

Related errors

Runtime Error 321 · Runtime Error 322 · Runtime Error 381