How to open a file

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Rei

How to open a file

Post by Rei » Wed Jan 26, 2005 9:11 pm

I am a real beginner. don't laugh anyone. How do I set up my new package of MS 7.2 to open an excel file every morning at 7:30am? It will then kick off an embedded macro and create a report I need.
That's it. Seems simple and I am annoyed I can't figure it out myself.
Thanks!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jan 26, 2005 9:31 pm

Outline of basic, crude, steps:

1. Open Excel and create an auto run macro. Consider modifying the macro to exit Excel when all done.
Save the spreadsheet file.

2. Script in Macro Schduler:

Code: Select all

ExecuteFile>Drive:\Path\SpreadsheetName.xls
Save Macro

3. Use Macro Properties to set schedule for 7:30am, daily (M-F?).

4. Keep Macro Scheduler running in systray. Macro should run at 7:30.
Note: Scheduled tasks will not work if not logged in.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Rei

Post by Rei » Wed Jan 26, 2005 9:55 pm

thanks! this worked... with one caveat. when excel opens, a window pops up asking to enable or disable macros. we recently moved to XP and I do not have admin rights to change the security settings and get rid of that pop up. I will call our tech support desk. thanks for your help Bob.
Rei

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jan 26, 2005 11:38 pm

You can modify the Macro Scheduler script to look something like the following untested outline:

Execute>Spreadsheet.xls
WaitWindowOpen>Excel*
WaitWindowOpen>MacroWarning*
SetFocus>MacroWarning*
Tab (to the OK/Accept field)
Press ENTER
WaitWindowClosed>MacroWarning*
-----------------------

See HELP for the proper syntax of the commands above
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Rei

Post by Rei » Fri Jan 28, 2005 4:31 pm

thanks again for your tips. I am not getting anywhere and my firm cannot offer support on this matter. I have the following in place:

//open file
ExecuteFile>N:\Sharedat\Perf\Urbani\Daily Lipper\Apps\PercentileMaster_v2.xls

//window called "Microsoft Excel" opens asking to enable/disable macro
WaitWindowOpen>Microsoft Excel*
SetFocus>Microsoft Excel*

//Alt-e activates "Enable Macro" command
Press ALT
Send>e
Release ALT

//close window and macro will start
WaitWindowCLosed>*

For some reason, the Alt-e is calling up the drop-down Edit menu, which tells me the WaitWindow command is not being recognized.

What am I missing?
THANKS!
Rei

Rei
Newbie
Posts: 1
Joined: Fri Jan 28, 2005 6:49 pm
Location: New York

Rei

Post by Rei » Fri Jan 28, 2005 7:04 pm

Resolved!!! I checked another thread - "Newbie with lots of problems..." and found the solution by using the Wait> command. Thank you to Bob for providing that tip.
Thanks!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Jan 28, 2005 10:17 pm

Looking at the code you provided it seems like there should have been a

WaitWindowOpen>EnableMacro*
SetFocus>EnableMacro*
Press>ALT
.....
....
....

The Alt-E that you are sending now is going to the main spreadsheet window. If you have just inserted a Wait> it may be a lucky accident that it is working. If there is any unexpected delay you will still be in the main window. Really should SetFocus> to the window prompting you to enable the Macro.

If you look closely at my original suggestion, there are two WaitWindowOpen> commands. Actually the first one is not needed, only the one that prompts for the enabling of the Macro. You only used one of the lines, but you selected the wrong one. I provided both so you could get a feeling of how the actions can be delayed until a specific window opens.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts