How to return data from getClipboardData?
compiler-errors, vba
Solution
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.
Problem
``` 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?