HOW TO close Excel instance started by mail merge

前端 未结 2 609
渐次进展
渐次进展 2021-01-24 11:14

HOW TO close Excel instance started by mail merge

this code running inside launcher does not have access to Excel running via DDE ??

\'For i = 1 To Work         


        
2条回答
  •  遥遥无期
    2021-01-24 11:52

    Excel can be closed via VBA, if called from within Excel

    Application.Quit
    

    If called from outside Excel, you will need to set a reference to Excel and then close it.

    Set appExcel = GetObject(, "Excel.Application")
    appExcel.Quit
    

    You need to ensure that all Workbooks are closed or saved, otherwise Excel will prompt the user to save.

提交回复
热议问题