1

'In VBA one disadvantage of calling a class procedure with CallByName ist that when an custom error was raised in the called object procedure, the caller always gets error 440 regardless of the original error number being raised.

Microsoft gives a workaround in this article http://support.microsoft.com/kb/194418/en-us.

It suggests instead of CallByName the use of InvokeHook. Therefore the library "TypeLib Information" (TLBINF32.DLL) must be added as a reference.

My question is: is this library available by default on every Windows PC, where only MS Office is installed (no Visual Studio etc.)?

Thanks in advance for your answers

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Theo Köster
  • 51
  • 1
  • 7
  • 1
    No, you are going to have to deploy it yourself. – Hans Passant Aug 14 '13 at 20:48
  • Thanks for your reply. Is there any other known way to bypass this limitation (440 Automation error) of CallByName? – Theo Köster Aug 14 '13 at 20:56
  • TLBINF32.DLL is missing and also only 32 bit - although you can create a 64-bit wrapper "COM+ Server" with the component services app built in. However it is possible to use various tricks to navigate the ITypeLib and ITypeInfo interfaces manually, and call ITypeInfo::Invoke that way. https://codereview.stackexchange.com/questions/274532/low-level-vba-hacking-making-private-functions-public#:~:text=stop%20typing%20now%3B)-,Update,-I%20tried%20removing <- This link does not answer the question here but should give the techniques and tips to point you on the right path. 10 years late... – Greedo May 05 '23 at 09:24

0 Answers0