Results 1 to 5 of 5

Thread: VB function in VBA

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Posts
    2

    VB function in VBA

    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.

  2. #2
    Addicted Member jeroenh's Avatar
    Join Date
    Aug 2000
    Location
    Rotterdam, Holland
    Posts
    201
    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.
    Catch you later,

    Jeroen Hoekemeijer
    Code:
    If 1 = 2 Then MajorError

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    What about the ShellExecute API?

  4. #4
    Addicted Member jeroenh's Avatar
    Join Date
    Aug 2000
    Location
    Rotterdam, Holland
    Posts
    201
    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.
    Catch you later,

    Jeroen Hoekemeijer
    Code:
    If 1 = 2 Then MajorError

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Posts
    2

    Smile

    Thanks for the advice.

    I'll try it out and see how I go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width