Scheduling

B

Ben Watts

I have a database that I need to import data into from an excel sheet. I
have created a macro that when ran, it imports the data. How do I get
windows scheduler to automatically do this and then the macro to autorun when
then task is ran. The database is called "outagedatabse" and the table to
import to is called "MDB". THe macro is called "Export" and the excel file
that holds the data is called "outageaccessdump". Any help would be greatly
appreciated. I am fairly new at access!
 
M

MAC

I have a database that I need to import data into from an excel sheet. I
have created a macro that when ran, it imports the data. How do I get
windows scheduler to automatically do this and then the macro to autorun when
then task is ran. The database is called "outagedatabse" and the table to
import to is called "MDB". THe macro is called "Export" and the excel file
that holds the data is called "outageaccessdump". Any help would be greatly
appreciated. I am fairly new at access!

What I would recommend is that you create a new database.
In this database:
Link the tables from the tables that you want to import into.
import the macro 'Export'.
create a new blank form. (You can add any kind of Text you like... eg
'Importing Records')
On the load event of this new form, have it run your Macro.
Set the form as the start up form. So that it automatically starts
when you open this new Database.
(Under Tools|Startup...|Display Form/Page)
You can modify your existing Macro to close the form and application
when it is done importing your data.
Finally, you can set Scheduler to open this new database at any hour
of the day or night.

The result should be that scheduler runs at your appointed time and
opens the new database.
Which automatically opens the start form, which has an on load event
that runs your Macro.
Your Macro imports the data and closes the form and database.

Hope this works for your particular need.

MAC
 
J

John W. Vinson

I have a database that I need to import data into from an excel sheet. I
have created a macro that when ran, it imports the data. How do I get
windows scheduler to automatically do this and then the macro to autorun when
then task is ran. The database is called "outagedatabse" and the table to
import to is called "MDB". THe macro is called "Export" and the excel file
that holds the data is called "outageaccessdump". Any help would be greatly
appreciated. I am fairly new at access!

You can use Windows Scheduler to run Access, opening the database and
executing a macro. The macro itself should contain (or call) the code which
specifies the Excel spreadsheet; the command line in the scheduler should be
something like

"%programfiles%\Microsoft Office\Office11\msaccess.exe"
"X:\SomePath\outagedatabse.mdb" /excl /x Export

Use your own drive name and path to outagedatabse, of course; the path to
msaccess.exe may be different depending on what version you're using; and the
/x command line switch will execute the named macro.

John W. Vinson [MVP]
 
Top