Object WorksheetFunction returns error values back to the embodiment; he just choking on them. Use the Excel object to WorksheetFunction function could not work with error value. You have already created the Excel.Application object; use this.
Recall for the creation (and destruction) with the application object CreateObject function can be avoided by making the object variable declaration static. This is particularly useful in the UDF, which can be copied on a long column.
Own worksheet function VLOOKUP written to allow full conversion columns without penalty; truncation of full column references a property Worksheet.UsedRange help of this function.
Option Explicit Public Function v_lookup(lookup_value As Variant, _ table_array As Range, _ col_index_num As Integer, _ Optional range_lookup As Boolean = False) As String Dim varResult As Variant Static objExcelAppVL As Object 'only create the object if it doesn't exist If objExcelAppVL Is Nothing Then Set objExcelAppVL = CreateObject("Excel.Application") objExcelAppVL.Visible = False End If 'restrict full column references to the worksheet .UsedRange Set table_array = objExcelAppVL.Intersect(table_array.Parent.UsedRange, table_array) varResult = objExcelAppVL.VLookup(lookup_value, _ table_array, _ col_index_num, _ range_lookup) If IsError(varResult) Then varResult = "" v_lookup = varResult 'do not destruct static vars - they are reused on subsequent calls 'objExcelAppVL.Quit 'Set objExcelAppVL = Nothing End Function _ Option Explicit Public Function v_lookup(lookup_value As Variant, _ table_array As Range, _ col_index_num As Integer, _ Optional range_lookup As Boolean = False) As String Dim varResult As Variant Static objExcelAppVL As Object 'only create the object if it doesn't exist If objExcelAppVL Is Nothing Then Set objExcelAppVL = CreateObject("Excel.Application") objExcelAppVL.Visible = False End If 'restrict full column references to the worksheet .UsedRange Set table_array = objExcelAppVL.Intersect(table_array.Parent.UsedRange, table_array) varResult = objExcelAppVL.VLookup(lookup_value, _ table_array, _ col_index_num, _ range_lookup) If IsError(varResult) Then varResult = "" v_lookup = varResult 'do not destruct static vars - they are reused on subsequent calls 'objExcelAppVL.Quit 'Set objExcelAppVL = Nothing End Function String Option Explicit Public Function v_lookup(lookup_value As Variant, _ table_array As Range, _ col_index_num As Integer, _ Optional range_lookup As Boolean = False) As String Dim varResult As Variant Static objExcelAppVL As Object 'only create the object if it doesn't exist If objExcelAppVL Is Nothing Then Set objExcelAppVL = CreateObject("Excel.Application") objExcelAppVL.Visible = False End If 'restrict full column references to the worksheet .UsedRange Set table_array = objExcelAppVL.Intersect(table_array.Parent.UsedRange, table_array) varResult = objExcelAppVL.VLookup(lookup_value, _ table_array, _ col_index_num, _ range_lookup) If IsError(varResult) Then varResult = "" v_lookup = varResult 'do not destruct static vars - they are reused on subsequent calls 'objExcelAppVL.Quit 'Set objExcelAppVL = Nothing End Function ) Option Explicit Public Function v_lookup(lookup_value As Variant, _ table_array As Range, _ col_index_num As Integer, _ Optional range_lookup As Boolean = False) As String Dim varResult As Variant Static objExcelAppVL As Object 'only create the object if it doesn't exist If objExcelAppVL Is Nothing Then Set objExcelAppVL = CreateObject("Excel.Application") objExcelAppVL.Visible = False End If 'restrict full column references to the worksheet .UsedRange Set table_array = objExcelAppVL.Intersect(table_array.Parent.UsedRange, table_array) varResult = objExcelAppVL.VLookup(lookup_value, _ table_array, _ col_index_num, _ range_lookup) If IsError(varResult) Then varResult = "" v_lookup = varResult 'do not destruct static vars - they are reused on subsequent calls 'objExcelAppVL.Quit 'Set objExcelAppVL = Nothing End Function .UsedRange Option Explicit Public Function v_lookup(lookup_value As Variant, _ table_array As Range, _ col_index_num As Integer, _ Optional range_lookup As Boolean = False) As String Dim varResult As Variant Static objExcelAppVL As Object 'only create the object if it doesn't exist If objExcelAppVL Is Nothing Then Set objExcelAppVL = CreateObject("Excel.Application") objExcelAppVL.Visible = False End If 'restrict full column references to the worksheet .UsedRange Set table_array = objExcelAppVL.Intersect(table_array.Parent.UsedRange, table_array) varResult = objExcelAppVL.VLookup(lookup_value, _ table_array, _ col_index_num, _ range_lookup) If IsError(varResult) Then varResult = "" v_lookup = varResult 'do not destruct static vars - they are reused on subsequent calls 'objExcelAppVL.Quit 'Set objExcelAppVL = Nothing End Function ) Option Explicit Public Function v_lookup(lookup_value As Variant, _ table_array As Range, _ col_index_num As Integer, _ Optional range_lookup As Boolean = False) As String Dim varResult As Variant Static objExcelAppVL As Object 'only create the object if it doesn't exist If objExcelAppVL Is Nothing Then Set objExcelAppVL = CreateObject("Excel.Application") objExcelAppVL.Visible = False End If 'restrict full column references to the worksheet .UsedRange Set table_array = objExcelAppVL.Intersect(table_array.Parent.UsedRange, table_array) varResult = objExcelAppVL.VLookup(lookup_value, _ table_array, _ col_index_num, _ range_lookup) If IsError(varResult) Then varResult = "" v_lookup = varResult 'do not destruct static vars - they are reused on subsequent calls 'objExcelAppVL.Quit 'Set objExcelAppVL = Nothing End Function
I see that you specifically pass the string, so the numbers and dates will be their text equivalents. I would suggest that this is the best way to get value in PowerPoint.
