Outlook VBA open excel -
i trying open existing excel sheet outlook. can see workbook open , imediately closes again. have excel.application set visible. ideas? here code.
function opennewform(todosubject) msgbox ("called") dim xlapp object dim sourcewb workbook dim sourcesh worksheet set xlapp = createobject("excel.application") xlapp .visible = true .enableevents = false end strfile = "c:\users\peter\documents\asi\ordersystem\newordersheet.xlsm" set sourcewb = workbooks.open(strfile, , false, , , , , , , true) set sourcesh = sourcewb.worksheets("orderform") sourcewb.activate end function
again code running in outlook. want keep file open once opens.
i got figured out. opening different workbook , closing before try open second 1 , interfering it. fix kept excel app open , reset workbook object new workbook wanted.
Comments
Post a Comment