I have some code and I thought it was pretty basic code but it's giving me a type mismatch error on the very last line. Any suggestions?
Code:
Sub Email()
Dim LR As Long
Dim ws As Worksheet
Dim vFilePath As String
Dim CurrentFile As String
Dim OutApp As Object
Dim OutMail As Object
Dim EmailTo As String
Dim EmailCC As String
Dim EmailSub As String
Dim EmailBody As String
vFilePath = Range("rFilePath").Value
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Master" And ws.Name <> "Check" And ws.Name <> "Data" And ws.Name <> "Template" _
And ws.Name <> "Library" And ws.Name <> "Total EQL Scorecard" And ws.Name <> "EQL Com Scorecard" _
And ws.Name <> "Control" Then
CurrentFile = vFilePath & ws.Range("A7") & ".xlsx"
ws.Copy
ThisWorkbook.Sheets("Master").Copy after:=ActiveSheet
ActiveWorkbook.SaveAs Filename:=CurrentFile, _
FileFormat:=xlOpenXMLWorkbook
ThisWorkbook.Activate
For LR = ThisWorkbook.Sheets("Library").Range("B2").End(xlUp) To 2 Step -1