Code Monkey home page Code Monkey logo

vb2clr's People

Contributors

jet2jet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vb2clr's Issues

Code Not Working

Dear jet2jet, thanks for sharing this great piece of code. I'm opening this issue because, unfortunately, I can't get it to work on my system. First of all, there are a few leftovers that prevent the compilation of the VBA project.

  1. The function ParseGUID is not defined. Not really a problem, I just recovered it from your website and I copy-pasted it in the script.
  2. CallGetIDsOfNamesImpl calls an undefined function VBQueryInterfaceByString. I couldn't find the declaration in your website, so I fixed the issue by removing the CallGetIDsOfNamesImpl.
  3. CLRInvokeMethodWithTypes was missing the ByVal MethodName As String argument. I added it manually in the function declaration to solve the issue.
  4. CLRInvokeMethodWithTypes2 was throwing an Invalid ParamArray Use error at ToObject(cmi).Invoke_3(obj, Arguments). For fixing this error, I declared a new variable Dim v() As Variant: v = Arguments and I passed it to the call of Invoke_3.
  5. In the function AddExitHandler there was trailing ^ characters near a pointer variable producing invalid code. They are, in fact, literal declaration of LongPtr type. Removing them fixed the issue, but I’m not sure it’s the correct way to go. Anyway it’s not a required feature.

Once all the fixes were implemented into the code, I was able to successfully compile the VBA project. So I decided to try it out with the example you wrote in the README file, the one that uses the .NET Regex class... but to now avail. The script fails during the initialization of the CLRHost class. Following, a small home-made stack trace:

  • RegexSample => Call host.Initialize(False)
  • Initialize => Set m_host = CreateCorRuntimeHost(Version)
  • CreateCorRuntimeHost => hr = VBCallAbsoluteObject(pMetaHost, 3, vbLong, StrPtr(Version), VarPtr(g(0)), VarPtr(pRuntimeInfo))
  • VBCallAbsoluteObject => hr = DispCallFunc(ObjPtr(Object), CLngPtr(IndexForVftable) * Len(argsPtr(0)), 4, CLng(RetType), c, argVt(lb), argsPtr(lb), VBCallAbsoluteObject)

ERROR: Runtime Error 80020010, Automation Error, Invalid Callee

Following, some additional information concerning my current environment:

  • Windows 10 x64
  • Excel 2016 x32
  • MSCORLIB.dll and MSCOREE.dll 2.4, Framework v4.0.30319, x32 Version

I hope you can really help me out in solving this issue because I would love to use your scripts for a project. Do you think it's possible to make this whole thing work on a 32bit version of Excel?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.