{"id":5246,"date":"2018-03-05T23:10:04","date_gmt":"2018-03-05T22:10:04","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=5246"},"modified":"2018-03-06T15:29:32","modified_gmt":"2018-03-06T14:29:32","slug":"excel-does-not-start-within-a-schedule-task","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/excel-does-not-start-within-a-schedule-task\/","title":{"rendered":"Excel: Does not start within a schedule task"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_5246 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_5246')){$('.twoclick_social_bookmarks_post_5246').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Excel%3A%20Does%20not%20start%20within%20a%20schedule%20task\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Aif%20you%20have%20already%20created%20a%20script%20and%20within%20you%20do%20some%20things%20with%20Excel%20by%20DCOM%20Excel.Application%20the%20script%20runs%20well%20as%20a%20user%20logged%20to%20the%20Desktop%20but%20not%20within%20a%20schedule%20task%20started%20by%20the%20same%20user.%0D%0A%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/excel-does-not-start-within-a-schedule-task\\\/\",\"post_id\":5246,\"post_title_referrer_track\":\"Excel%3A+Does+not+start+within+a+schedule+task\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>if you have already created a <a href=\"https:\/\/michlstechblog.info\/blog\/powershell-control-excel-remotely\/\" rel=\"noopener\" target=\"_blank\">script<\/a> and within you do some things with Excel by DCOM Excel.Application the script runs well as a user logged to the Desktop but not within a schedule task started by the same user.<\/p>\n<p><!--more--><\/p>\n<p>The root cause are some missing folders and permissions in the systemprofile folder and missing DCOM Permissions to launch Excel.<\/p>\n<p>Start a command shell cmd.exe with Administrator permissions and create the following folders if it not exists:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmkdir C:\\Windows\\SysWOW64\\config\\systemprofile\\AppData\r\nmkdir C:\\Windows\\SysWOW64\\config\\systemprofile\\Desktop\r\nmkdir C:\\Windows\\System32\\config\\systemprofile\\AppData\r\nmkdir C:\\Windows\\System32\\config\\systemprofile\\Desktop\r\n<\/pre>\n<p>Then set Modify permissions for the user who should start excel<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nicacls C:\\Windows\\SysWOW64\\config\\systemprofile\\AppData \/grant myDomain\\myUser:(OI)(CI)(R)(RX)(M)\r\nicacls C:\\Windows\\SysWOW64\\config\\systemprofile\\Desktop \/grant myDomain\\myUser:(OI)(CI)(R)(RX)(M)\r\nicacls C:\\Windows\\System32\\config\\systemprofile\\AppData \/grant myDomain\\myUser:(OI)(CI)(R)(RX)(M)\r\nicacls C:\\Windows\\System32\\config\\systemprofile\\Desktop \/grant myDomain\\myUser:(OI)(CI)(R)(RX)(M)\r\n<\/pre>\n<p>Open DCOM Configuration. Depending of our Office Version (x86 or x64). For a 32Bit Office<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmmc.exe comexp.msc \/32\r\n<\/pre>\n<p>and for System default<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmmc.exe comexp.msc\r\n<\/pre>\n<p><figure id=\"attachment_5254\" aria-describedby=\"caption-attachment-5254\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-1-300x180.png\" alt=\" DCOM Management Console\" width=\"300\" height=\"180\" class=\"size-medium wp-image-5254\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-1-300x180.png 300w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-1.png 429w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-5254\" class=\"wp-caption-text\">DCOM Management Console<\/figcaption><\/figure><br \/>\nSet permissions<br \/>\n<figure id=\"attachment_5255\" aria-describedby=\"caption-attachment-5255\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Permissions-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Permissions-1-300x227.png\" alt=\"DCOM Permissions\" width=\"300\" height=\"227\" class=\"size-medium wp-image-5255\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Permissions-1-300x227.png 300w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Permissions-1.png 391w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-5255\" class=\"wp-caption-text\">DCOM Permissions<\/figcaption><\/figure><br \/>\nSet the Launch and Activation permissions<br \/>\n<figure id=\"attachment_5252\" aria-describedby=\"caption-attachment-5252\" style=\"width: 241px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Launch-Activation-Permissions.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Launch-Activation-Permissions-241x300.png\" alt=\"DCOM  Launch and Activation Permissions\" width=\"241\" height=\"300\" class=\"size-medium wp-image-5252\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Launch-Activation-Permissions-241x300.png 241w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Launch-Activation-Permissions.png 361w\" sizes=\"auto, (max-width: 241px) 100vw, 241px\" \/><\/a><figcaption id=\"caption-attachment-5252\" class=\"wp-caption-text\">DCOM  Launch and Activation Permissions<\/figcaption><\/figure><br \/>\nand finally set the Access permissions<br \/>\n<figure id=\"attachment_5253\" aria-describedby=\"caption-attachment-5253\" style=\"width: 243px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Access-Permissions.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Access-Permissions-243x300.png\" alt=\"DCOM Access Permissions\" width=\"243\" height=\"300\" class=\"size-medium wp-image-5253\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Access-Permissions-243x300.png 243w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/03\/DCOMExcel-Access-Permissions.png 358w\" sizes=\"auto, (max-width: 243px) 100vw, 243px\" \/><\/a><figcaption id=\"caption-attachment-5253\" class=\"wp-caption-text\">DCOM Access Permissions<\/figcaption><\/figure><\/p>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, if you have already created a script and within you do some things with Excel by DCOM Excel.Application the script runs well as a user logged to the Desktop but not within a schedule task started by the same user.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[89,134,136,1145,1144,1065],"class_list":["post-5246","post","type-post","status-publish","format-standard","hentry","category-windowsscripts","tag-error","tag-excel","tag-excel-application","tag-not-start","tag-schedule","tag-task"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=5246"}],"version-history":[{"count":6,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5246\/revisions"}],"predecessor-version":[{"id":5258,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5246\/revisions\/5258"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=5246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=5246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=5246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}