I created a "Test" macro in Sheet1 of an excel sheet "Data" and trying to call it from vbs file
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\xxx\xxxx\xxxx\VB\Data.xlsm")
objExcel.Application.Run "C:\xxx\xxxx\xxxx\VB\Data.xlsm!Sheet1.Test"
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
WScript.Quit
I am getting following error: The macro may not be available in this workbook or all macros may be disabled. Code: 800A03EC
I changed macro security to "Enable all macros" and also checked "Trust access to the VBA Project model" under Developer Macro settings. But still no luck