I have this code as is all perfect, but the use is using the file ext some time as ".xlsm" or ".xls".
How should i modify the code so that if the file ext is .xlsm or .xls it will work.
any idea or suggestions.
How should i modify the code so that if the file ext is .xlsm or .xls it will work.
any idea or suggestions.
VBA Code:
'
=====================================================================================
'Check if all the Raw files are avalaible in folder
'=====================================================================================
If Sheets("Reference").Range("a2").Value = "" And Sheets("Reference").Range("a3").Value = "" And Sheets("Reference").Range("a4").Value = "" Then
MsgBox "Dear User all the 4 Raw files are not avalaible in folder" & vbNewLine & Fpath & vbNewLine & "Download raw file & Run the scrip again"
End
End If
'=====================================================================================
' 1. Check Raw data in folder sheet Abandon calls Report
'=====================================================================================
If Sheets("Reference").Range("c2").Value <> "Abandon calls Report" Then
MsgBox "Abandon calls Report Raw file not avaliable" & vbNewLine & "Download raw file & Run the scrip again", vbCritical, "Raw File Required"
End
End If
If Len(Dir(Fpath & "\" & "Abandon calls Report.xlsx")) = 0 Then '' ---- ''Here it can be .xlsx or .xls
MsgBox "Abandon calls Report Raw file Not avaliable in the folder" & vbNewLine & Fpath & vbNewLine & "Download raw file & Run the scrip again"
End
End If
'=====================================================================================
' 1. ImportDaily Abandon calls Raw data
'=====================================================================================
If Sheets("Reference").Range("c2").Value = "Abandon calls Report" Then
Sheets("Abandon calls Raw data").Visible = True
Windows("RTMC Daily ReportV3.xlsm").Activate
ActiveWorkbook.Sheets("Abandon calls Raw data").Activate
Cells.Select
Selection.ClearContents
Application.CutCopyMode = False
Set wbsource = Workbooks.Open(Fpath & "\" & "Abandon calls Report.xlsx") '' ---- ''Here it can be .xlsx or .xls
Windows("Abandon calls Report.xlsx").Activate '' ---- ''Here it can be .xlsx or .xls
Cells.Select
Selection.Copy
Windows("RTMC Daily ReportV3.xlsm").Activate
ActiveWorkbook.Sheets("Abandon calls Raw data").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
wbsource.Close
End If