HI Friends,
I have below code working well, to bring the excel file name in particular folder, but i wanted only to bring the file name if it is read only, which part of the code i have to change for this. i tried changing File = Dir(Path & "*.xlsx",wbreadonly). still it is not working. any help appreciated.
Regards
Ajaar
I have below code working well, to bring the excel file name in particular folder, but i wanted only to bring the file name if it is read only, which part of the code i have to change for this. i tried changing File = Dir(Path & "*.xlsx",wbreadonly). still it is not working. any help appreciated.
Code:
Sub bringfilename()
Dim ctr As Integer
ctr = 5
Path = "G:\General\"
File = Dir(Path & "*.xlsx")
Do Until File = ""
ActiveSheet.Cells(ctr, 2).Value = File
ctr = ctr + 1
File = Dir()
Loop
end sub
Regards
Ajaar