vba - How can I run an Excel macro from an Outlook macro? -


how can run excel macro outlook macro?

you need add microsoft excel 14.0 data objects library. go tools -> references.

you need open workbook before can run macro it.

this should work:

 dim exapp excel.application  dim exwbk workbook  set exapp = new excel.application  set exwbk = exapp.workbooks.open("c:\folder\folder\file.xls)  exapp.visible = true   exwbk.application.run "modulename.yourmacro"   exwbk.close savechanges:=true 

if want run macro in background , not open visible instance of excel, set exapp.visible false.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -