Excel VBA Macro: Check content (of clipboard?) before pasting

后端 未结 4 1301
误落风尘
误落风尘 2021-01-06 07:29

I\'ve had some serious issues with pasting data from various sources into Excel. Excel tends to try to be smart and does all kinds of silly formating. We need the data as te

4条回答
  •  臣服心动
    2021-01-06 08:00

    For clipboard access/manipulation, you'll want to add a reference to the Microsoft Forms 2.0 library in Project->References. You can then use the MSForms.DataObject class that has (among others) a GetFormat method to check whether the clipboard has a particular type of data.

    This is a pretty good intro to clipboard handling using DataObject.

提交回复
热议问题