I get a runtime error 53 "file not found" by using dir to get filename. as below:
The debug stops at fileName = Dir(folderPath & "\"). Many thanks in advance!Please Login or Register to view this content.
I get a runtime error 53 "file not found" by using dir to get filename. as below:
The debug stops at fileName = Dir(folderPath & "\"). Many thanks in advance!Please Login or Register to view this content.
OS X uses a different path separator than windows. you want to use "/" rather than "\". it's also possible to use ":"
if you need this code to work on both windows & OS X then you can use Application.PathSeparator to return the correct path separator for the current system.
ron de bruin's site has some excellent info on writing mac-specific VBA and has a whole section on working with files & folders
Thanks thatandyward. I did find the code from his website however it's giving me the error.
At the bottom of that page, it says: "it return a path like this :
Macintosh HD:Users:RDB:Desktop:YourFolder:
And in 2016 a path like this :
/Users/RDB/Desktop/YourFolder/".
Does it mean I should not add the "/" in dir(folderpath) at all because it's already in the returned path?
Something like:
Please Login or Register to view this content.
Last edited by aprildu; 05-27-2017 at 11:16 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks