| Which user... |
Charles Strahan provided a rated reply to Chris Wieman on Monday, November 03, 2008 3:22 PM |
|
Are you using the same user to run the script in both cases? You might want to check file permissions and the such if you've selected a user to run the task under other than the the one you tested in the cmd prompt. That's pretty much all I can think of- that's pretty strange. Hope you get it figured out!
Regards, -Charles
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| Other issues refered by Lalji Mer |
| Chris Wieman replied on Tuesday, November 04, 2008 10:07 AM |
|
The first reference does not apply, as I don't have a function in Excel trying to run. The script does all of the work. And I don't understand how the 2nd reference applies to me at all.
-chris
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| Other issues - Which User |
| Chris Wieman replied to Charles Strahan on Tuesday, November 04, 2008 10:08 AM |
|
In both cases (via schedule and locally) I'm running it as Network Admin.
Thanks,
-chris
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| vbscript excel schedule task |
C_A P provided a rated reply to Chris Wieman on Tuesday, November 04, 2008 10:34 AM |
|
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")errJobCreated = objNewJob.Create _
("Excel.exe", "********040000.000000-420", _
True , 1 OR 4 OR 16, , , JobID)
Wscript.Echo errJobCreated
This script will run excel every monday, wednesday and friday at 04:00,
then you can set at workbook_open to do what you want and close the
file.
I hope this helps!
source from : http://www.vbaexpress.com/forum/archive/index.php/t-2328.html also try this http://www.codeproject.com/KB/shell/ScheduledTaskWizard.aspx
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| Things that caused me issues - maybe some help |
Peter Wylie provided a rated reply to Chris Wieman on Monday, November 17, 2008 3:18 PM |
|
Hi Chris,
I had a similar problem to you and found a solution eventually. The best way to test for problems is to watch the task run while you're logged in as the same user. Using this method I was able to find out that 2 things in particular weren't helping
Macro Security - I've had to set this to 'low' (in Excel under Tools, Macros, Security) so that the 'Enable Macros/Disable Macros' prompt doesn't appear when Excel opens a macro workbook. This is far from ideal, so I'm now looking into digitally signing the macros.
AutoRecover - This has had to be completely shut down (in Excel under Tools, Options), as it was halting macro execution by forcing the 'user' to make a decision on what to do with potentially recovered workbooks from another session. There appear to be two settings for this - one referring to a specific workbook, and the other to do with the actual installation of Excel for that particular user - that's how I've interpreted it anyway. Both are in Tools, Options.
Unfortunately since last week the same problem has returned where Excel appears to open and then do nothing. I've stripped a test right back down to a macro which literally quits Excel as soon as it runs, and even that isn't currently working. I suspect a recent Windows update and believe the problem is either user permissions or something new in Excel - unfortunately that doesn't narrow it down very much.
Good luck,
Peter.
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| Other Issues - Excel via Scheduled task |
| Chris Wieman replied to Peter Wylie on Monday, November 17, 2008 3:26 PM |
|
Peter,
Thank you for the hints. But it works interactively, so Macro security and AutoRecover do not seem to be a part of the problem/solution. And worse, it functions perfectly under XP. So I have it running on my laptop, which is not ideal, as I have to leave it running.
Thank you,
-chris
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
|