Forum Discussion

Oussama's avatar
Oussama
Occasional Contributor
10 years ago
Solved

Execute VBA Excel Macro from TestComplete Script

Hello,   I have the following need :   - I can open an Excel workbook from my TestComplete script. This excel Workbook has two VBA macros : toto() and titi()   - Now, I want to execute only the...
  • TanyaYatskovska's avatar
    10 years ago

    Hi Oussama,

    We have a sample article demonstrating how to execute a macro:

    function Test()
    {
      // Gets Excel objects
      var excel = Sys.OleObject("Excel.Application");
     
      // Runs a macro
      excel.Run("toto")
    }