Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to return data from getClipboardData?

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?

like image 708
jwoolard Avatar asked Jun 23 '09 14:06

jwoolard


People also ask

How can I retrieve data from clipboard?

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.

What is GetClipboardData API function?

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.


1 Answers

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.

like image 71
Joel Goodwin Avatar answered Sep 26 '22 22:09

Joel Goodwin