2017-11-19 4 views
0

この単純なコードを実行していても問題が発生しています。誰でも光を照らすことができますか?フォルダ内の単純なループファイルの読み込みがまったく実行されない

Sub GetFilest() 
    Dim file As String 
    file = Dir("\ttsnas02\user_mdocs$\tdf8273\Documents\Rob\External supplier timesheet\CSV Supplier Main\Inbox folder\*.xlsm") 

    Dim row As Integer 
    row = 1 

    Do While file <> "" 
     Cells(row, 1) = file 
     row = row + 1 
     file = Dir() 
    Loop 

End Sub 
+0

'万一 "\ ttsnas02 \ .... ''こと" \\ ttsnas02 \ ....'? (それは現在のドライブのルートディレクトリからぶら下がっているパスよりもUNCであるように見えます) – YowE3K

+0

はい、ありがとうございました – pran86

答えて

0
Sub GetFilest() 
Dim file As String 
file = Dir("\ttsnas02\user_mdocs$\tdf8273\Documents\Rob\External supplier timesheet\CSV Supplier Main\Inbox folder\*.xlsm") 

Dim row As Integer 
row = 1 

    Do While file <> "" 
    Cells(row, 1) = file 
    row = row + 1 
    'try to remove code below (why you reassign file variabel with Dir() function..?) 
    'file = Dir() 

Loop 

End Sub 
関連する問題