|
#1
|
|||
|
|||
Cannot edit an Excel worksheet from scheduled task
I am trying to edit an Excel worksheet using the sample provided here:
http://kinook.com/Forum/showthread.p...el.Application with small changes (attached is the bld and excel file). When trying to run this bld file -both tom VBP and from a scheduled task -all works ok from my machine (WinXP X86,VBP 8.0 X86,MS Office 2007). When I try it from another build machine -W2k8 R2 X64,VBP 8.0 X64,MS Office 2010 -it works ok from VBP environment,the log says: 7/5/2012 6:44:36 PM: Building project step 'mod worksheet'... xlApp object is NOT empty! xlBook object is NOT empty! xlSheet object is NOT empty! Cell 1,1 has value:1000 7/5/2012 6:44:36 PM: Build successfully completed (elapsed = 00:00:00). But when running this build from a scheduled task -never works. Log says: 7/5/2012 6:44:06 PM: Building project step 'mod worksheet'... xlApp object is NOT empty! xlBook object is empty!!! xlSheet object is empty!!! 7/5/2012 6:44:06 PM: Build successfully completed (elapsed = 00:00:00). So I would like to ask you what could be the problem causing this bld project not to work from a scheduled task (basically for some reason xlBook and xlSheet are empty objects )... |
#2
|
|||
|
|||
Not sure, but you can reproduce the problem outside of Visual Build by putting the script code in a .vbs file and calling via cscript.exe in a scheduled task.
|
#3
|
|||
|
|||
i tried that ,made a VBScript (attached) -it runs ok when launched normally (objects are not empty) ,does not work from scheduled task (objects are empty)
So it is the same behaviour like in VBP.Question is why ... |
#4
|
|||
|
|||
Ask Microsoft.
|
#5
|
|||
|
|||
ok,I will.Tks.
|
#6
|
|||
|
|||
After a lot of search I founded a resolution for this problem.
After I created manually the Desktop folder -sch task finished ok. http://blogs.msdn.com/b/sqlserverfaq...rver-jobs.aspx Resolution ************ · A “Desktop” folder seems to be necessary in the “systemprofile” folder in the location C:\Windows\SysWOW64\config\ to open an Excel file · Create the “Desktop” folder for Windows 2008 Server (x64) under the location C:\Windows\SysWOW64\config\systemprofile · And for a 32 bit Windows 2008 Server create the “Desktop” folder under the location C:\Windows\System32\config\systemprofile |
Thread Tools | |
Display Modes | Rate This Thread |
|
|