Apologies if this has been answered already, but couldn't find it if it has.
Folder contains a Master file with one worksheet. and several other files with multiple sheets.
Following extract from Master File macro should find and open each file in the Active Workbook folder, but it's throwing an error when setting the current folder path?
Option Explicit
Dim FindRng As Range
Dim fName, fPath, myPath As String
Dim File As Variant
Dim wbTarget, wbThis As Workbook
Dim sht1, sht2 As Worksheet
Sub AllFiles()
Application.EnableCancelKey = xlDisabled
'Should set folder path from active "master" workbook, but triggers "Compile error - Object required" at ".Path"
Set fPath = ActiveWorkbook.Path
If Right(fPath, 1) <> "\" Then fPath = fPath & "\"
Application.ScreenUpdating = False
fName = Dir(fPath & "*.xls*")
Do While fName <> ""
Set wbTarget = Workbooks.Open(fPath & fName)
Hope someone can see the problem
All solutions, suggestions and alternatives welcome as ever
Ochimis
Bookmarks