Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling a Visual Basic procedure from Excel (2000)

    1. As I recall when I have *MyMacro* in an Excel Add-in,
    I create a cmdButton in a Worksheet and attach to it:
    MyMacro
    --no need to even name the Addin (as long as there
    is not the same macro name also in the current
    Wbk)

    2. I can also use the following line to call *MyMacro* from within another
    wbk macro:

    Application.Run (gsAddinName & "!MyMacro").

    Now, I want to move *MyMacro* to a Visual Basic 6.0 module
    and still call it from Excel. VB will be running as I use it as a
    FrontEnd to load Excel and to close Excel when finished.
    Then VB is closed to end the session.

    Is this possible? and if so, what is the syntax for each of the
    two cases above?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calling a Visual Basic procedure from Excel (2000)

    I don't think you can call a procedure from a VB.exe, you'd have to create a DLL in VB6. You could then set a reference to the DLL in your Excel workbook.

  3. #3
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calling a Visual Basic procedure from Excel (2000)

    Hans.
    Ah yes, I'll use the VB Standard.exe for the Front Loader then create a new VB project using ActiveXDLL to hold the runtime procedures.

    Thanks

Posting Permissions

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