Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Task Schedule for Macro

Hi all,,

Here is a quick question- trying to run my macro every morning with th
windows 2000 task scheduler.

in the "run" box, I put this:

"G:\Mike\Allmort Composite SWP.xls" /x mailselection

and do "start in"

G:\Mike


It loads up my excel file, but the macro does not run. What am I doin
wrong?

Thanks!
Mik

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Task Schedule for Macro

HI mike0021,
To start by writing with NotePad a small script such as:

' Here, the full path name of the workbook to open
Const xlName = "G:\Mike\Allmort Composite SWP.xls"
Dim xl, Wbk
Set xl = WScript.CreateObject("Excel.Application")
Set Wbk = xl.Workbooks.Open(xlName)
' Here, the workbook macro name to execute (in a standard module)
xl.Run "MyMacro"
Wbk.Save
Wbk.Close False
xl.Quit
Set xl = Nothing

save this file in the same directory "G:\Mike\" with the .vbs extension (for
example: MyMacroToRun.vbs).

In the task scheduler, put in the "run" box:
"G:\Mike\MyMacroToRun.vbs"

Regards,
MP

"mike0021 " a écrit dans le message de
...
Hi all,,

Here is a quick question- trying to run my macro every morning with the
windows 2000 task scheduler.

in the "run" box, I put this:

"G:\Mike\Allmort Composite SWP.xls" /x mailselection

and do "start in"

G:\Mike


It loads up my excel file, but the macro does not run. What am I doing
wrong?

Thanks!
Mike


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Task Schedule for Macro

Thank you so much! It worked! One little followup though- part of m
excel spreadsheet uses the WORKDAY function, and this function i
giving me #NAME? when running the macro through this script, however i
works if I load excel and run interactively.

This WORKDAY function needs the Analysis Tool-pak, an addin. Is i
possible that this addin doesn't load without actually opening u
excel. Is there any work around if this is the issE?

Thanks again!

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Task Schedule for Macro

Hi mike0021,
In the vbs script, you can add (*):
Set xl = WScript.CreateObject("Excel.Application")
xl.AddIns("Analysis Tool-pak").Installed = True ' (*)

Regards,
MP

"mike0021 " a écrit dans le
message de ...
Thank you so much! It worked! One little followup though- part of my
excel spreadsheet uses the WORKDAY function, and this function is
giving me #NAME? when running the macro through this script, however it
works if I load excel and run interactively.

This WORKDAY function needs the Analysis Tool-pak, an addin. Is it
possible that this addin doesn't load without actually opening up
excel. Is there any work around if this is the issE?

Thanks again!!


---
Message posted from http://www.ExcelForum.com/



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
How do I schedule a task to print a document Hershmab Excel Discussion (Misc queries) 11 May 13th 09 02:27 PM
Macro to Support a task in excel VM Excel Discussion (Misc queries) 2 March 26th 09 05:33 PM
I have a complex task that I think could be easy with a macro RHein Excel Discussion (Misc queries) 0 January 3rd 08 08:39 PM
Event macro for a task TUNGANA KURMA RAJU Excel Discussion (Misc queries) 8 January 6th 06 10:43 AM
macro to automise the task TUNGANA KURMA RAJU Excel Discussion (Misc queries) 3 December 7th 05 07:42 PM


All times are GMT +1. The time now is 09:52 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"