I have a macro that should open all the files in a specific folder, and then select a specific sheet from it and leave it so that when the file is opened, the sheet is opened first.
Macro is here, i tried it and it goes without any warnings but the files doesn't have the wanted sheet first when i open them.
Dim fso, f, fl, fc, sPath As String
Set fso = CreateObject("Scripting.FileSystemObject")
sPath = "C:\Test\"
Set f = fso.GetFolder(sPath)
Set fc = f.Files
For Each fl In fc
Workbooks.Open sPath & fl.Name
With Workbooks(fl.Name)
.Sheets("Testsheet").Select
.Close (True)
End With
Next fl
Help anyone?
Macro is here, i tried it and it goes without any warnings but the files doesn't have the wanted sheet first when i open them.
Dim fso, f, fl, fc, sPath As String
Set fso = CreateObject("Scripting.FileSystemObject")
sPath = "C:\Test\"
Set f = fso.GetFolder(sPath)
Set fc = f.Files
For Each fl In fc
Workbooks.Open sPath & fl.Name
With Workbooks(fl.Name)
.Sheets("Testsheet").Select
.Close (True)
End With
Next fl
Help anyone?