ab =
CreateObject("Broker.Application");
Fn3 = ParamStr(
"Fund3",
"WTM24");
Fn4 = ParamStr(
"Fund4",
"FDRXX");
Fn5 = ParamStr(
"Fund5",
"WTM25");
stock3 =
ab.Stocks(Fn3);
stock4 =
ab.Stocks(Fn4);
stock5 =
ab.Stocks(Fn3);
FName3 =
stock3.FullName;
FName4
= stock4.FullName;
FName5
= stock5.FullName;
The following produces an error in the last shown
line:
ab =
CreateObject("Broker.Application");
Fn3 = ParamStr( "Fund3",
"WTM24");
Fn4 = ParamStr( "Fund4",
"FDRXX");
Fn5 = ParamStr( "Fund5",
"WTM25");
stock3
= ab.Stocks(Fn3);
stock4
= ab.Stocks(Fn4);
stock5
= ab.Stocks(Fn5);
FName3
= stock3.FullName;
FName4 =
stock4.FullName;
FName5 =
stock5.FullName; <<<< Line with
error
Error Msg = COM object variable is not initialized or
has invalid type (valid COM object handle required)
Look closely. The definition of stock5
changes subtley from the no error state to the error state.
I used copy/paste for the statements,
then changed the variables. I cannot get rid of the error message.
Fn5 always has contained a valid statement and a valid fund in the default
position of the ParamStr statement.
Any ideas?
Ken