Mac コンピューターの VBA コードに問題があります。Windowsでは問題なく動作します。ディレクトリの指定と関係があることは知っていますが、正しい構文についてはわかりません。
ワークブックはフォルダーにあり、ワークブックと同じフォルダーにある別のフォルダー (Datatextfiles) を指定したいと考えています。
'Change Path
Dim strPath As String
Dim MyDir As String
MyDir = ActiveWorkbook.Path
strPath = MyDir & "/Datatextfiles/"
Dim strExtension As String
'Stop Screen Flickering
Application.ScreenUpdating = Falsew
'Change extension
strExtension = Dir(strPath & "*.txt")
clearData
Do While strExtension <> ""