Using IE to seed the clipboard

Weaver

Well-known Member
Joined
Sep 10, 2008
Messages
5,197
I had a bit of vbs code that seeded certain strings into the clipboard

Code:
    With CreateObject("internetexplorer.application")
        .navigate ("about:blank")
        .document.parentwindow.clipboarddata.SetData "text", a
        .Quit
    End With
I need to use this in excel but as it currently stands, it issues an alert "Do you want this webpage to access your clipboard". Can I override this? Or is there a better way to achieve the same result?
 
It late binds the MSForms.DataObject. I don't think you can use that in VBS, but I might be wrong.
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Am I right in thinking late binding is used to remove the need to register references?
 
Upvote 0
Yes. If you set a reference to the MSForms library then you just Set ... = New MSForms.DataObject instead.
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,448
Members
452,915
Latest member
hannnahheileen

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