Is it possible to use a VB function in VBA? If so how? For example I'd rather use the VB Shell function as it has more variants (thus more customisable) than the VBA Shell function. Unfortunetly I'm only using VBA for Excel so I'm stuck.
Thanks.
Printable View
Is it possible to use a VB function in VBA? If so how? For example I'd rather use the VB Shell function as it has more variants (thus more customisable) than the VBA Shell function. Unfortunetly I'm only using VBA for Excel so I'm stuck.
Thanks.
No, this is not possible. VBA is a smaller version of VB and the main diffrence is that it lacks functionality.
You could however make a DLL that calls the VB functions with the requested paramaters, and refrence this DLL in VBA. This way you can use the VB Functions. The only minus about this construction is the loading of runtime librairies. Excel automaticly load these for VBA. But when your DLL is called the VB6 runtime files will be needed. This wil take 2 to 3 seconds extra on a bad PC.
What about the ShellExecute API?
That's also an answer to the question. You could also declare the API function like you would in VB. Didn't think of that.
Thanks for the advice.
I'll try it out and see how I go.