Forgot to put the code I have so far:-Outlook is installed on the server (server is secure, only we access it)This code seems to open the file, but does not run the auto macro I have in it.declare @xlApp integer, @rs integer,@xlWorkbooks integer,@xlWorkbook integer,@xlWorkSheet integer,@FileName varchar(100),@sql varchar(4000),@filepath varchar(250), @sd varchar(30), @ed varchar(30), @cd varchar(30), @cmd varchar(30),@itable varchar(150), @mtable varchar(150),@srchstring varchar(200),@esrdp varchar(30),@esrdp2 varchar(6)execute @rs = dbo.sp_OACreate 'Excel.Application', @xlApp OUTPUT--turn off screen updating and displayalerts--execute @rs = master.dbo.sp_OASetProperty @xlApp, 'ScreenUpdating', 'False'--execute @rs = master.dbo.sp_OASetProperty @xlApp, 'DisplayAlerts', 'False'--open workbook--declare @xlWorkbooks integerexecute @rs = master.dbo.sp_OAMethod @xlApp, 'Workbooks', @xlWorkbooks OUTPUT--declare @xlWorkbook integerexecute @rs = master.dbo.sp_OAMethod @xlWorkbooks, 'Open', @xlWorkbook OUTPUT, 'N:\ExcelMacro1.xlsm' --open worksheet--declare @xlWorkSheet integerexecute @rs = master.dbo.sp_OAMethod @xlWorkbook, 'ActiveSheet', @xlWorkSheet OUTPUT--clean upexecute @rs = master.dbo.sp_OAMethod @xlWorkbook, 'Close'execute @rs = master.dbo.sp_OAMethod @xlApp, 'Quit'--finally destroy all pointersexecute @rs = master.dbo.sp_OADestroy @xlWorkSheetexecute @rs = master.dbo.sp_OADestroy @xlWorkbookexecute @rs = master.dbo.sp_OADestroy @xlWorkbooksexecute @rs = master.dbo.sp_OADestroy @xlApp
How do i get the macro inside the workbook to run?