Mar 27 2022
I am getting an automation error when I include the AssessmentFile.close statement. Also this code just copies the worksheets in the last workbook of input folder.
Set AssessmentFile = Workbooks.Open(FileName:=myPath & myFile)
For Each ws In AssessmentFile.Worksheets
ActiveSheet.Name = Replace(myFile, myExtension, "")
myFile = Dir
outputFile = outputFilePath & outputFileName
strFileExists = Dir(outputFile)
If strFileExists = "" Then
'**getting an automation error in this step
AssessmentFile.SaveAs FileName:=outputFile, FileFormat:=xlWorkbookNormal**
If IsFileOpen(outputFile) Then
Else: Kill outputFile
AssessmentFile.SaveAs FileName:=outputFile, FileFormat:=xlWorkbookNormal
Any help is much appreciated.