locked
C#.net Program fails for automation of word document update RRS feed

  • Question

  • Hi Team,

    I have one automation program, it will read the excel file and create a word document copy based on word template.

    The program is working fine when I call / run command prompt. If I schedule the program in windows scheduler, the log says that 

    "Microsoft Excel cannot access the file 'E:\testfile.xlsx'. There are several possible reasons:

     

    The file name or path does not exist.

    The file is being used by another program.

    The workbook you are trying to save has the same name as a currently open workbook.

    2014-04-24 11:13:21 ReleaseObject Exception:Object reference not set to an instance of an object.

    2014-04-24 11:13:21 ReleaseObject Exception:Object reference not set to an instance of an object."

    1) The program is running fine when I run from command prompt.

    2) The program is scheduled on Windows 2012 OS - 64 bit, Server is installed with Office 2013, Schedule task fails showing log as above

    I have tested the following but no luck.

    1) created Desktop folder in (C:\Windows\SysWOW64\config\systemprofile,C:\Windows\System32\config\systemprofile), but does not help me, But I did not get the above error, program runs for long time, no template generates, So I manually stopped the process.

    2) The folders are having full permission to the user, so there will not be a chance of permission.

    3) I modified the windows schedule to "Run only when user is logged on", then it is working.

    4) I changed back to "Run whether user is logged on or not", it is not working, I have given Admin credentials.

    5) Tried to run the same program, in Windows 2008 64bit, Office 2007, with windows schedule, the program runs.

    Please help to fix the above problem, whether Office 2013 problem, Windows 2012 task schedule problem, or my program problem.?

    Thanks in Advance.

    Regards

    Saikrishna Mamidi




    Thursday, April 24, 2014 3:01 PM

All replies