tags:

views:

285

answers:

1
+1  A: 

From the KB article you linked to:

One caveat is that if you pass multiple parameters, they need to be passed in reverse-order.

From MSDN, the parameters to OpenText are:

expression.OpenText(Filename, Origin, StartRow, DataType, 
TextQualifier, ConsecutiveDelimiter, Tab, Semicolon, Comma, 
Space, Other, OtherChar, FieldInfo, TextVisualLayout, DecimalSeparator, 
ThousandsSeparator, TrailingMinusNumbers, Local)

So if param1 holds your filename then you are currently trying to pass that as the Local parameter and you aren't passing anything to the Filename parameter which is required

barrowc
Awesome!!! Thanks for pointing out the parameter order. Doing that and correctly initializing the missing VARIANT parameter(paramOpt) to; paramOpt.vt = VT_ERROR;paramOpt.scode = DISP_E_PARAMNOTFOUND;solved the problem. Thanks again.
ChadNC