Using Clipboard_SetData function to copy small table

Peter_W

New Member
Joined
Apr 2, 2018
Messages
31
Hello,

Within Access 2010. I am familiar with using the the Windows API, and then creating the function, Clipboard_SetData, which will copy some data to the clipboard, when called. Testing this, the function works fine for a small string of data.

However, in my database, I would like to use the Clipboard_SetData function to copy a small, one-column table, called Orders, which is filled with about a dozen, 8-character strings.

So my question is, would anyone have a quick example of the code to do this? I have seen many examples of the function, but the code examples almost always look like like:

Clipboard_SetData ("A single, small string sample like this")

Again, how would I use this function to copy the contents of a table to the clipboard? The table Orders will vary over time slightly, but will always be a single column of strings.

Thank you in advance for any response here.
 
Welshgasman, I had a typo in the code. Also, I needed to add MSForms (FM20.dll) under references too. The code works like a champ now! THANK YOU! Made my day, to say the least. Thanks RoryA for the tip. Will have to try ADO some day, but usually I can get the DAO code like this to work. Thanks again!

Yeh, I was going to post the reference required.
If you are using the code you posted, you don't need the parameters. That was so it could be used with any table/query and field.?
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Peter_W,

How did you find the correct reference library for that function.?
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top