Hi,

I have created my own public function to open up a file with a string type argument, and the function should let me know whether the file is open ok by setting the My function as true.

Public fundction Myfunction (filename as string) as Boolean

Well, I found that to use this function to open a file, I tried to pass the filename, I need to use MyFunction("Filename") and it works ok. But when I tried to use string variable to replace the fix file name, it just does not work. Say,

Dim myFileName as string

myFileName = "FileName"

If MyFunction(myFileName) = True then.........

It just ignore this as it never find the right file name.

Could you help ?

Thanks.