T
tonedeafdave
Using Excel VBA on the Mac, I need to prompt the user for a directory
(not a file).
I have tried bits of code from the Excel help files, but they simply
don't work. e.g.
1.
fred = Application.Dialogs(xlDialogFindFile).Show (Method show failed,
error 1004)
2.
Application.FindFile (Method findfile failed, error 1004)
3. (from the help file on "Strategies for Developing Cross-Platform
Solutions")
Dim ffFind As FileFind
Set ffFind = Application.FileFind
With ffFind
.Options = msoOptionsNew
.Name = "New"
.SearchPath = "Macintosh HD:Users:Shared"
.Execute
For i = 0 To .FoundFiles.Count - 1
MsgBox .FoundFiles(i)
Next i
End With
('.name' won't compile - among other problems with this code)
QUESTION 1.
Is this because I am using the student version of Excel for Mac? Is
there more stuff in the professional version? I will get it at once if
there is.
QUESTION 2.
Any ideas on how to approach this problem?
QUESTION 3.
Right now I have fallen back on getopenfilename. This only gets files
of course. I want to look for CSV files. It seems there is a code name
for each file type, because MAC does not support wild cards. Does
anyone know the 4 letter code for CSV files? I thought it was CSVn but
that does not seem to work for any single digit n.
(not a file).
I have tried bits of code from the Excel help files, but they simply
don't work. e.g.
1.
fred = Application.Dialogs(xlDialogFindFile).Show (Method show failed,
error 1004)
2.
Application.FindFile (Method findfile failed, error 1004)
3. (from the help file on "Strategies for Developing Cross-Platform
Solutions")
Dim ffFind As FileFind
Set ffFind = Application.FileFind
With ffFind
.Options = msoOptionsNew
.Name = "New"
.SearchPath = "Macintosh HD:Users:Shared"
.Execute
For i = 0 To .FoundFiles.Count - 1
MsgBox .FoundFiles(i)
Next i
End With
('.name' won't compile - among other problems with this code)
QUESTION 1.
Is this because I am using the student version of Excel for Mac? Is
there more stuff in the professional version? I will get it at once if
there is.
QUESTION 2.
Any ideas on how to approach this problem?
QUESTION 3.
Right now I have fallen back on getopenfilename. This only gets files
of course. I want to look for CSV files. It seems there is a code name
for each file type, because MAC does not support wild cards. Does
anyone know the 4 letter code for CSV files? I thought it was CSVn but
that does not seem to work for any single digit n.