Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unattended Macro
If you go to the vbe and right click on the ThisWorkbook entry in the
project explorer (under your workbook name), and select view code, you will get the module where workbook level events can be placed. If you click in the left dropdown as the top of the module, and select workbook, then in the right dropdown at the top of the module, you select open, it will enter the declaration for the workbook_Open event which will run whenever the workbook is opened and macros are not disabled. Private Sub Workbook_Open() End Sub If you put your code within this procedure or call your code from this procedure, it will run when the workbook is opened either manually or through code. You can use the Schedular app under system tools to provide the command to open this file using excel at appropriate times. Your macro can do something like: Worksheets(Array("Sheets1","Sheets5","Sheets7")).C opy ActiveWorkbook.SaveAs "C:\myFolder\MyFile" & format("yyyymmdd") & ".xls" to save a portion of your workbook to a unique filename - as an example. -- Regards, Tom Ogilvy "buckle" wrote in message news:3f40eef4@nubby2.... Is the following possible? Run a scheduled task to open an Excel spreadsheet and run a macro automatically, then close the spreadsheet and return to the desktop. Seems simple enough but I can't see where to make the macro auto start when the spreadsheet opens. Also is it possible to save part of the spreadsheet to a unique file name (in the macro)? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unattended Macro
Thanks Tom. It's so easy when someone else does all the hard work!
Cheers |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
need help to update macro to office 2007 macro enabled workbook | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions |