Home > OS >  VBA cannot call made of c # method at 424 error
VBA cannot call made of c # method at 424 error

Time:11-06

C # write a number of ways, VBA call times out of 424 error,

C # method code is as follows:
Public List MakeListHashTable ()
{
List Tabs=new List (a);
Hashtable TAB=new Hashtable ();

TAB. Add (" testMap1 ", "012345");
TAB. Add (" testMap2 ", "543210");
TAB. Add (" testMap3 ", "987654");

Tabs. Add (TAB);

Return tabs.
}

VBA code, as follows:
The Function makeListHashTable ()
Dim objClass As LibYamlCs. LibYamlCs
The Set objClass=New LibYamlCs. LibYamlCs

Dim ret As Object
The Set ret=objClass. MakeListHashTable ()
MakeHashTable=ret (0). The Item (" testMap1 ")
End the Function



VBA code Dim ret As Object into a Dim ret
Execution after [makeHashTable=ret (0). The Item (" testMap1 ")] reported type mismatch error error (13)

After debugging
Ret types for the Variant/Object
Ret (0) do not match the types for the Variant/Integer type


When you return to the Hashtable data type c # VBA can obtain the elements inside the content of the normal,
Bosses know how this is?
  • Related