Cannot access excel file

后端 未结 3 541
遇见更好的自我
遇见更好的自我 2021-01-11 17:11

I\'m developing a windows service, generating a report. This report has a template. This template is prepared in an excel file. This file is copied to the output folder.

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-11 17:35

    To safety run Office applications (Excel and others) under user service with Local system account you must know two important things: 1) In Windows Server 2008/2008 R2 you must manually create two folders: C:\Windows\system32\config\systemprofile\desktop
    C:\Windows\SysWow64\config\systemprofile\desktop (for x64 version only) Without this folders you cannot correct run office Applications from Local SystemAccount

    2) If you service is configured without desktop interaction then in the first time launched office application (Excel for example) freeze on user credentials dialog - you cannot see this window in this mode - to resolve this enable desctop interacting, switch to office window after you service run it and manually enter credeentials.

    Other information there(use google translater to read).

提交回复
热议问题