Windows to Mac VLB Error.

R

raydog

I am getting an error when running this macro on my Mac, of course it
works fine on the PC.

Here is the code, HELP....


'FILE SELECTION:
Application.DisplayAlerts = False
InputCSV = Application.GetOpenFilename("All Files (*.*), *.*", , _
"INPUT: Select Raw Data (CSV delimited)", , True)
If VarType(InputCSV) = vbBoolean Then Exit Sub


I just want to push a button on the worksheet and bring up the open
file box.
BTW, all of our data files are sent from the server as CSV files.


If anyone can help let me know, I can even send the entire file for you
to debug if needed.
 
B

Bob Greenblatt

I am getting an error when running this macro on my Mac, of course it
works fine on the PC.

Here is the code, HELP....


'FILE SELECTION:
Application.DisplayAlerts = False
InputCSV = Application.GetOpenFilename("All Files (*.*), *.*", , _
"INPUT: Select Raw Data (CSV delimited)", , True)
If VarType(InputCSV) = vbBoolean Then Exit Sub


I just want to push a button on the worksheet and bring up the open
file box.
BTW, all of our data files are sent from the server as CSV files.


If anyone can help let me know, I can even send the entire file for you
to debug if needed.
The problem is obvious. Read the help file for getopenfilename. The
Macintosh does not use the same file filter specification as windows. Use
conditional compilation, or a run time platform check to execute the correct
variation of the code.

When coded properly, you "can just push a button on the worksheet and bring
up the open file box." I guess you also realize that this code WILL NOT open
the file, but simply return the file name selected by the user.
 
R

raydog

My problem is I am not a programmer, this code was gifted to me by a
gentleman who has since left for another job. So. I thank you for your
input but I have no idea what you are talking about.

I did look at the getopenfilename item in help. Ever seen a deer in
headlights?
 
B

Bob Greenblatt

My problem is I am not a programmer, this code was gifted to me by a
gentleman who has since left for another job. So. I thank you for your
input but I have no idea what you are talking about.

I did look at the getopenfilename item in help. Ever seen a deer in
headlights?
You can get this to run on the Macintosh by changing the fist line.
Change: Input CSV = Application.GetOpenFilename("All Files (*.*), *.*", , _
To: InputCSV=Application.getopenfilename(, , _

This deletes the file specification. When this same code runs on windows the
open dialog box will show all files, not just csv files.

If there are other problems, just keep posting them here. Or if you would
like the program converted to run on the Mac, I'd be happy to give you a
quotation after I examined the file.
 

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