Private Sub importClipboard_Click()
Dim data As Collection
data = getClipboardData()
...do something...
End Sub
Function getClipboardData() As Collection
...do something...
End Function
I get
Compile error: Argument not optional"
on the line:
data = getClipboardData()
There no arguments to the getClipboardData()
function - so how can I be missing one?
To get to your clipboard history at any time, press Windows logo key + V. From the clipboard history, you can paste and pin frequently used items by choosing an individual item from your clipboard menu. Pinning an item keeps it from being removed from the clipboard history to make room for new items.
The system performs implicit data format conversions between certain clipboard formats when an application calls the GetClipboardData function. For example, if the CF_OEMTEXT format is on the clipboard, a window can retrieve data in the CF_TEXT format.
It's a bad error message, but your problem is a common one - you've got to put Set data = getClipboardData()
as you're returning an object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With