Is it possible to run a macro in Excel from external command?

后端 未结 3 1503
无人共我
无人共我 2021-01-07 12:31

Let\'s say I want to program a VBA code in an external program that opens an Excel file, runs a macro, saves (and say yes to any pop up windows), and close Excel. Is it poss

3条回答
  •  Happy的楠姐
    2021-01-07 13:14

    Depending on what you are trying to achieve you may also 'control' Excel via (OLE) Automation from another application such as Access or Word or from your own application written in another environment such as Visual Basic (6). It is also possible to achieve this via .Net using a language of your choice (although some are easier to implement than others).

    Are you wanting to control Excel from an external application or simply trigger a VBA macro in an existing workbook from the outside?

    Again, depending on your intention, the workbook could have an Auto Open macro which could be conditional run based on an external value (say an ini file or database value).

提交回复
热议问题