Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Jun 2002
    Location
    Toronto, Ontario
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Call Excel VBA from VB (Officew 2000/VB6)

    How do I call a vba macro inside a workbook after opening the workbook in VB?
    I'm opening up an Excel Spreadsheet template, opening up a VB form for data entry and then saving the excel as a new name. I want to execute a small date routine which resides in the spreadsheet, before the VB form opens for data entry.

    Thanks
    John

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Call Excel VBA from VB (Officew 2000/VB6)

    You can call on Excel's Application.Run method, e.g if in your code you have xlApp as an Excel object you can use

    xlApp.Run "MacroName",

    where MacroName is the name of the macro.

    Andrew C

Posting Permissions

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