Macro Open Text File

J

jai

Hello all

I've recently moved over to MAC. Been using a macro that open a text
file. However, in Excel 2004 for MAC an error appears:

Run Time Error 1004

Method 'GetOpenFileName' of object '_Application' failed

I hope someone can help.

Look forward to any replies.

regards

BFGK
 
J

JE McGimpsey

Hello all

I've recently moved over to MAC. Been using a macro that open a text
file. However, in Excel 2004 for MAC an error appears:

Run Time Error 1004

Method 'GetOpenFileName' of object '_Application' failed

Take a look at the GetOpenFileName method in VBA Help - the FileFilter
argument syntax is different between Macs and Windows XL versions.

If you have to (or want to) use the file on both Macs and Win platforms,
use conditional compilation, e.g.:

#If Mac Then
GetOpenFileName(<mac syntax>)
#Else
GetOpenFileName(<win syntax>)
#End If
 
Top