Hello everyone,
Given Code getting values from closed workbook where extension is .xls. But now some file is .xlsx format. Where file extention is .xlsx this code not working. please give some idea how to open .xls and .xlsx files. Can we use OR Condition?
Sub test()
If Range("b1").Value = "Gratuity" Then
GetValuesFromAClosedWorkbook "D:\Office\PRG 2014\Testing", Range("a1").Value & ".xls", "Gratuity", "c2:Q472"
Else
GetValuesFromAClosedWorkbook "D:\Office\PRG 2014\Testing", Range("a1").Value & ".xls", "Gratuity (funded)", "c2472"
End If
End Sub
Thanks.
Ajit
Given Code getting values from closed workbook where extension is .xls. But now some file is .xlsx format. Where file extention is .xlsx this code not working. please give some idea how to open .xls and .xlsx files. Can we use OR Condition?
Sub test()
If Range("b1").Value = "Gratuity" Then
GetValuesFromAClosedWorkbook "D:\Office\PRG 2014\Testing", Range("a1").Value & ".xls", "Gratuity", "c2:Q472"
Else
GetValuesFromAClosedWorkbook "D:\Office\PRG 2014\Testing", Range("a1").Value & ".xls", "Gratuity (funded)", "c2472"
End If
End Sub
Thanks.
Ajit