alfranco17
Board Regular
- Joined
- Apr 14, 2013
- Messages
- 198
Hi.
I am trying to use the DIR function to loop through all the files in a folder. This is my code:
However, when the name includes a character such as í, I get an error message like this one:
Run-time error '1004':
Sorry, we could not find Cfvico.xlsx. Is it possible it was moved, renamed or deleted?
Windows shows the file name is "Cφvico".
The name should be "Cívico".
Is there a way to get around accented characters in filenames?
Thanks.
Armando
I am trying to use the DIR function to loop through all the files in a folder. This is my code:
Code:
Sub OpenAll() vPath = "C:\Users\Armando\Desktop\"
ChDir vPath
NextFile = Dir(vPath & "\*.xlsx")
Do While NextFile <> ""
Workbooks.Open Filename:=NextFile
NextFile = Dir
Loop
End Sub
However, when the name includes a character such as í, I get an error message like this one:
Run-time error '1004':
Sorry, we could not find Cfvico.xlsx. Is it possible it was moved, renamed or deleted?
Windows shows the file name is "Cφvico".
The name should be "Cívico".
Is there a way to get around accented characters in filenames?
Thanks.
Armando