Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scheduled task method of opening Excel questions.
Hello All,
I have a workbook that needs updating overnight. I'm trying to achieve this by using the Windows Scheduled Tasks function. Currently I'm just trying to get Excel open. However, I'm getting a couple of prompts when Excel opens to which I need to click Ok. One is a general system security message, and the other is to confirm my login details to Sun Vision. Can this be done? Also, How do I get a specific excel file opened by the Scheduled Task? Thanks Richard |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scheduled task method of opening Excel questions.
I have a .vbs file that opens Excel and processes a target workbook (runs a
macro). I set the scheduled task to run the .vbs file. Code is provided below for you to adapt as desired. I can't help you on the prompts- if they are Excel specific prompts you may be able to use .displaynotifications; if you are actually required to sign in to another system you may be able to use sendkeys. Sample code for an uncomplicated, scheduled Excel macro: strUserIn = MsgBox("Do you want to run the XYZ file ?",vbYesNo,"Automated Prompt") If strUserIn = 6 then Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open("C:\path\filename.xls") objExcel.Visible = True objExcel.Run "CrunchIt" 'the name of my macro objExcel.ActiveWorkbook.Save objExcel.ActiveWorkbook.Close(0) objExcel.Quit end if "Richard Burton" wrote: Hello All, I have a workbook that needs updating overnight. I'm trying to achieve this by using the Windows Scheduled Tasks function. Currently I'm just trying to get Excel open. However, I'm getting a couple of prompts when Excel opens to which I need to click Ok. One is a general system security message, and the other is to confirm my login details to Sun Vision. Can this be done? Also, How do I get a specific excel file opened by the Scheduled Task? Thanks Richard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Excel macro from Scheduled Task | Excel Worksheet Functions | |||
Trying to run a MSQuery from Excel as a Scheduled Task | Excel Discussion (Misc queries) | |||
Export Excel data and scheduled task | Excel Programming | |||
Running an Excel Macro as a Scheduled Task | Excel Programming | |||
Opening an add-in hangs when run from scheduled task | Excel Programming |