VBA-Excel: Storing multiple data In the Windows Clipboard

In earlier sessions  you saw how to put text in the windows clipboard (Putting Text In The Windows Clipboard) with the help of PutInClipboard() and Data Object and how to get the text from the Clipboard using GetFromClipboard() and Data Object.

In this session you will learn how to store multiple data’s in Clipboard and retrieve them. For storing multiple data’s, you need to store values as pair, Keys and Values or you can say format identifier and while retrieving the data from the Clipboard you will use these format identifiers to get the data. This data can be String, Long, Integer.

For storing multiple data in Clipboard, Follow the below steps.

Read moreVBA-Excel: Storing multiple data In the Windows Clipboard

VBA-Excel: Putting Text In The Windows Clipboard

For working with Windows Clipboard you need DataObject, the object in MSForms library. It provides support for text-string.
For that you must add the reference “Microsoft Forms 2.0 Object Library”
How to add “Microsoft Forms 2.0 Object Library”
Now, For putting text in the Clipboard, Follow the below steps.
Steps:
•    Initialize the Data Object, the type of MSForms.DataObject
•    Create a String
•    Set the String into Data Object using SetText() method.
•    Put the data in ClipBoard using PutInClipboard

Read moreVBA-Excel: Putting Text In The Windows Clipboard