jet2jet / vb2clr Goto Github PK
View Code? Open in Web Editor NEWThe helper class for Visual Basic for Applications (VBA) 7.0, providing access to CLR (.NET Framework) assemblies and classes.
License: BSD 3-Clause "New" or "Revised" License
The helper class for Visual Basic for Applications (VBA) 7.0, providing access to CLR (.NET Framework) assemblies and classes.
License: BSD 3-Clause "New" or "Revised" License
i think that will be useful.
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.
ParseGUID
is not defined. Not really a problem, I just recovered it from your website and I copy-pasted it in the script.CallGetIDsOfNamesImpl
calls an undefined function VBQueryInterfaceByString
. I couldn't find the declaration in your website, so I fixed the issue by removing the CallGetIDsOfNamesImpl
.CLRInvokeMethodWithTypes
was missing the ByVal MethodName As String
argument. I added it manually in the function declaration to solve the issue.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
.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:
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.