Search code examples
excelexcel-2011vba

excel 2011 mac VBA open file - error 75


I am just starting out with VBA on Excel 2011 for MAC. I have run the code below on Windows without a hitch, but get error 75 on mac. Any help much appreciated:

Sub cr_acc()
   Dim rdata() As String, idxData As Long     

   Open "\Volumes\SMALL 1\1.txt" For Input As #1
      rdata = Split(Input(LOF(1), #1), ";")
   Close #1

   idxData = 1

   Do While idxData < UBound(rdata)
      Debug.Print rdata(idxData)
   Loop

End Sub

Solution

  • I don't use the Mac for VBA but I do recall that specifying filepaths is different because of the differences in the OS.

    From memory you have to specify the path using colon separators, include the name of your hard disk and also include your user name within the path. Add your own MyName and try something like:

    MyPath = "Macintosh HD:Users:MyName:Desktop:TestFolder:MyFile.xlsx".

    This is untested but should give you a starting point along with this link.