![]() |
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 |
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 |
All times are GMT +1. The time now is 10:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com