I'm having a problem creating a condition. Please see pseudo code below. thanks in advance
Check if File A.xls is open If File A.xls is Open
Close File A.xls
Else
Convert File A.csv to .xls
End If
Convert File A.csv to .xls
Dim DeleteEntries As Workbook
Dim WorksheetDeleteEntries As Worksheet
Dim WbOpen As Boolean
'Convert Acc_FR044_SAP.csv to excel
strDir = "C:\FR044 Automated Checker\"
strFile = Dir(strDir & "Acc_FR044_SAP.csv")
If Workbooks("Acc_FR044_SAP.xls") Is Nothing Then ' IM HAVING AN SUBSCRIPT ERROR IN THIS LINE
WbOpen = False
Else
Workbooks("Acc_FR044_SAP.xls").Close SaveChanges:=False
End If
Application.DisplayAlerts = False
Do While strFile <> ""
Set wb = Workbooks.Open(Filename:=strDir & strFile, Local:=True)
wb.SaveAs Replace(wb.FullName, ".csv", ".xls"), FileFormat:=xlExcel8
wb.Close True
Set wb = Nothing
strFile = Dir
Loop