update XL file from secured mdb via script - corrupts excel file

L

Laurel

I'm trying to automatically update an excel file from a secured Access database - want this to occur at certain times of the day.
Have the excel file as a linked table in the db
i created a script that creates an Adodb.connectio
opens the database with provider, datasource, my login name & password, etc. and runs an update query (query works fine in Access).
Then I close the connection object.
and set object to nothing

seems to run fine. But then if I try and open the excel file, excel balks and immediately closes (and wants to send an error report.) So I deleted the bad excel file. started over, ran the script and tried to open the linked excel file in access and get the error: "External table is not in the expected format.

Any ideas? (either solving this problem or better way to do this?
(my plan was to use Scheduler to run the script at 2 specific times of the day and it would update the excel file based on data in the db.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top