ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro Execution (https://www.excelbanter.com/excel-discussion-misc-queries/150004-macro-execution.html)

C Brandt

Macro Execution
 
This should be simple, but I cannot find an example.

What I want to do, is every morning, at 3:00 AM, auto execute a macro that
will rename data files. The reason for this is that another auto-executed
routine will be downloading new data into my system from another location
and likes to use the same filename every day.

In a blank spreadsheet, I've written the procedure that accomplishes the
renaming, but am at a lose as to how to auto execute it, when the sheet is
opened. Since I am unfamiliar with the world of object oriented programming,
example coding is the best way to get me started. Thank you.

I am now off looking for a way to schedule the spreadsheet to be opened
every morning at 3.

Any ideas?

Craig



Pete_UK

Macro Execution
 
You will find example code showing you how to do this he

http://www.cpearson.com/excel/OnTime.aspx

Hope this helps.

Pete

On Jul 12, 9:46 pm, "C Brandt" wrote:
This should be simple, but I cannot find an example.

What I want to do, is every morning, at 3:00 AM, auto execute a macro that
will rename data files. The reason for this is that another auto-executed
routine will be downloading new data into my system from another location
and likes to use the same filename every day.

In a blank spreadsheet, I've written the procedure that accomplishes the
renaming, but am at a lose as to how to auto execute it, when the sheet is
opened. Since I am unfamiliar with the world of object oriented programming,
example coding is the best way to get me started. Thank you.

I am now off looking for a way to schedule the spreadsheet to be opened
every morning at 3.

Any ideas?

Craig




Gord Dibben

Macro Execution
 
You could use Windows Task Scheduler to fire up Excel and your workbook at
3:00am.

The workbook would have workbook_open code to run the macro.

Private Sub Workbook_Open()
macroname or code goes here
End Sub

Entered in Thisworkbook module.

Or in a general module

Sub Auto_Open()
macroname or code goes here
End Sub

You could add to your code to close Excel when done

Application.Quit


Gord Dibben MS Excel MVP

On Thu, 12 Jul 2007 15:46:27 -0500, "C Brandt" wrote:

This should be simple, but I cannot find an example.

What I want to do, is every morning, at 3:00 AM, auto execute a macro that
will rename data files. The reason for this is that another auto-executed
routine will be downloading new data into my system from another location
and likes to use the same filename every day.

In a blank spreadsheet, I've written the procedure that accomplishes the
renaming, but am at a lose as to how to auto execute it, when the sheet is
opened. Since I am unfamiliar with the world of object oriented programming,
example coding is the best way to get me started. Thank you.

I am now off looking for a way to schedule the spreadsheet to be opened
every morning at 3.

Any ideas?

Craig




All times are GMT +1. The time now is 07:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com