Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Excel macro from Scheduled Task coolthinking Excel Worksheet Functions 4 July 13th 09 03:35 PM
Trying to run a MSQuery from Excel as a Scheduled Task Doug Excel Discussion (Misc queries) 1 March 6th 09 06:01 PM
Export Excel data and scheduled task joannele71 Excel Programming 2 August 28th 08 06:37 PM
Running an Excel Macro as a Scheduled Task Dan Youngren via OfficeKB.com Excel Programming 1 June 7th 05 11:32 PM
Opening an add-in hangs when run from scheduled task [email protected] Excel Programming 0 May 25th 05 04:17 PM


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"