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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top