Forum Home
Press F1
 
Thread ID: 22848 2002-07-31 23:26:00 Access & Excel - passing values parry (27) Press F1
Post ID Timestamp Content User
67111 2002-07-31 23:26:00 Hi, I have a macro within Access that does a RunApp to open an Excel workbook. The Workbook has an Auto_Open macro that runs & imports data from a text file, massages the data then closes itself.

The issue I have is that after Access opens the Excel workbook, the next line in the macro runs a query to import from this workbook. I keep getting a File Reservation error in Access because Excel hasnt yet finished it's macro and closed itself, so Access thinks the workbook is open and being used.

What I want is to be able to tell Access when Excel has finished this operation so that I can continue on and import the data from the workbook.

Any suggestions on how to solve this would be appreciated.
parry (27)
67112 2002-08-01 05:53:00 Looks like you may need to build in a WAIT or alternatively a Function to check If the Excel file is open.
That's what I would do in Excel VB but I am not familiar with Access VB syntax.
Russell D (18)
67113 2002-08-01 06:54:00 Thanks. Since posting I've read about something called DDE which is supposed to be able to pass data but doesnt look too straight-forward to me.

I will try and work out some code with a wait statement that keeps looping every few seconds to see if the workbook is open. Just need to find the syntax. Hopefully Access Help will have something.

Thanks for your suggestion.

Parry.
parry (27)
1