How to use NSWorkspaceMBS.launchApplicationAtFile?

My app opens a Filemaker file. When starting Filemaker there sometimes is a problem with timing when checking open files. Therefore, I wanted to use NSWorkspaceMBS.launchApplicationAtFile instead of an AppleScript. But how do I use this?

dim theError as NSErrorMBS dim theFilemakerApp as NSRunningApplicationMBS = NSWorkspaceMBS.launchApplicationAtFile(FilemakerArchivePath, 0, Nil, theError)

Gives an error

And theFilemakerApp is nil. However, Filemaker is started and the file is opened fine.

@Beatrix Willius — launchApplicationAtFile opens an application, not a file