Hello All
Just got a new Windows 7 computer and installed Office 2013. I have a report that saves itself as a pdf in a temp folder and then attaches the pdf to an email and sends it out. I use a macro to run the report and everything works fine from there. I have a VBS file that runs the macro and clicking the vbs file makes everything work fine. the code is below.
When I tried to run it though the task scheduler it show as completing fine, but it doesn't. So I added a reference the vbs in a batch file (below) and output the logs to a temp file. After I ran the batch and opened the log I seen the message
Any ideas? I turned UAC all the way down. turn off the virus scanner, and have local and domain admin access. I'm at bit a lose here. I had this working before but can't seem to remember how I did it. This is just one example I have several other reports that were schedule to run overnight, but they basically all use the same code and processes.
Just got a new Windows 7 computer and installed Office 2013. I have a report that saves itself as a pdf in a temp folder and then attaches the pdf to an email and sends it out. I use a macro to run the report and everything works fine from there. I have a VBS file that runs the macro and clicking the vbs file makes everything work fine. the code is below.
When I tried to run it though the task scheduler it show as completing fine, but it doesn't. So I added a reference the vbs in a batch file (below) and output the logs to a temp file. After I ran the batch and opened the log I seen the message
Wed 03/19/2014 14:11:17.74 Username
C:\Users\*****\Desktop\Auto Reports\aragingrecent.vbs(1, 1) Microsoft VBScript runtime error: Permission denied: 'CreateObject'
Wed 03/19/2014 14:11:17.77
Any ideas? I turned UAC all the way down. turn off the virus scanner, and have local and domain admin access. I'm at bit a lose here. I had this working before but can't seem to remember how I did it. This is just one example I have several other reports that were schedule to run overnight, but they basically all use the same code and processes.
Code:
'launch macro
set accessApp = CreateObject("Access.Application")
accessApp.OpenCurrentDatabase "C:\Users\******\Desktop\Auto Reports\AgedTrialBalance.mdb"
accessApp.DoCmd.RunMacro "MCRecent"
accessApp.CloseCurrentDatabase
accessApp.Quit
set accessApp = nothing
Code:
'My batch file
@echo off
echo %date% %time% %username% >> c:\temp\test.txt
cscript //nologo "C:\Users\*****\Desktop\Auto Reports\aragingrecent.vbs" 1>>c:\temp\test.txt 2>>&1
echo %date% %time% >> c:\temp\test.txt
Exit
Last edited: