路径在PC上但不是Mac [英] Path working on PC but not Mac
本文介绍了路径在PC上但不是Mac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
工作簿在一个文件夹中,然后我想指定另一个文件夹(Datatextfiles),它是相同的文件夹作为工作簿。
'更改路径
Dim strPath As String
Dim MyDir As String
MyDir = ActiveWorkbook.Path
strPath = MyDir& / Datatextfiles /
Dim strExtension As String
'停止屏幕闪烁
Application.ScreenUpdating = Falsew
'更改扩展名
strExtension = Dir(strPath&* .txt)
clearData
尽管strExtension<>
解决方案
Mac上的文件夹分隔符的正确名称是一个冒号:如
ChDirKathyStringHD:Library:WebServer:Documents :DispatchReports:InTime:
I am having a problem with my VBA code on my mac computer. It works fine on Windows. I know it has something to do with specifying directory but I'm not sure on the right syntax.
The workbook is in a folder and then I want to specify another folder (Datatextfiles) which is in the same folder as the work book.
'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 <> ""
解决方案
NOne of y'all are right. The proper designation for a folder separator on mac is a colon ':' Such as
ChDir "KathyStringHD:Library:WebServer:Documents:DispatchReports:InTime:"
这篇关于路径在PC上但不是Mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文