Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: visual Basic and excel

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I posted something on this yesterday, and today the entire forum (Macro forum??) is gone... hmm.....

    Well, someone had mentioned that to run an Excel macro from Visual basic I would have to create an 'object'? In visual basic. I was hoping someone could give me a little help on this or perhaps another way of running an excel macro from a visual basic program I'm writing.

    Thank you very much for any help.

    Shawn

  2. #2
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,607
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try something like this (hope it helps):


    Sub RunXLMacro()

    Dim objXL As Excel.Application
    Dim objWbk As Excel.Workbook

    Set objXL = New Excel.Application

    Set objWbk = objXL.Workbooks.Open("R:m-zRussellMiscExcelHelpArrayHelpAndMacroCallFromVB.xls")

    objWbk.Application.Run "MacroNameHere"

    objWbk.Close False
    Set objWbk = Nothing

    objXL.Quit
    Set objXL = Nothing

    End Sub



    -Russell

  3. #3
    New Member
    Join Date
    Feb 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'll give that a try.

    Thanks, I'll let you guys know how it works.

    Shawn

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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