Oldrat
New Member
- Joined
- Oct 23, 2017
- Messages
- 5
Hi
I am trying to open hidden workbooks using vba then change the attributes to vbnormal, if I use the specific workbook name, this code works fine.
But I am trying to find and change any workbooks in the folder with a common part file name.
The code below appears to work to find and open workbooks that are visible, but does not find the hidden ones.
Could someone tell me what I'm doing wrong please ?
Many Thanks
Lee
I am trying to open hidden workbooks using vba then change the attributes to vbnormal, if I use the specific workbook name, this code works fine.
Code:
Sub Macro1()
Workbooks.Open Filename:="D:\Lee\Downloads\KLT-TempZvQkUb084152"
MsgBox ActiveWorkbook.Name
SetAttr ActiveWorkbook.FullName, vbNormal
End Sub
But I am trying to find and change any workbooks in the folder with a common part file name.
The code below appears to work to find and open workbooks that are visible, but does not find the hidden ones.
Code:
Sub OpenFiles()
Dim Filepath As String
Dim Findfile As String
Filepath = "D:\Lee\Downloads\"
Findfile = Dir(Filepath & "\KLT-TempZvQkUb*.xls")
Do Until Findfile = ""
Workbooks.Open Filename:=Filepath & "" & Findfile
Findfile = Dir
Loop
End Sub
Could someone tell me what I'm doing wrong please ?
Many Thanks
Lee