Link to home
Start Free TrialLog in
Avatar of Rahul Sehrawat
Rahul Sehrawat

asked on

Excel to Access Dynamic Linking

Hello,

I want to dynamically link an excel file with access. There are many calculations like age and all where the data is calculated against the current date.

What I understand is, it is impossible to link an excel file with calculations. Now what I want is, that the user will be choose an excel file (can be 2003, 2007 or 2010 format). It will open the excel file (which will calculate the fields with calculations), save it and close the file. and will dynamically link/import the data.

Regards,
Avatar of mbizup
mbizup
Flag of Kazakhstan image

You can't directly write to a linked Excel file from Access.  Linked Excel files are read-only. See the following:
http://www.theregister.co.uk/2006/02/07/microsoft_office_access_infringement/

A workaround would be to either link to an Excel File (read only) or import it using Docmd.TransferSpreadsheet.

Query/modify data as needed in local access tables and queries, and then export the modified/calculated data as needed.
Avatar of Rahul Sehrawat
Rahul Sehrawat

ASKER

But is it not possible, to open and then save the file and then close it. because upon opening the excel file, it will update all the calculated fields.
If you turn off Automatic Calculation in Excel when the file is open, and then save the file, that will stop the file from updating the fields automatically when you open the file in the future, until you press F9 or select Calculate Now from the Formulas tab in Excel (presuming you are using Excel 2007/2010, that is).
Hi,

I actually want it to do automatic calculation. So even when I open the excel file, it actually calculates the fields. So I dont want to turn off automatic calculations.
anshuverma1989,

...Then perhaps you are not making the parameters of your process clear:...?

<I want to dynamically link an excel file with access.>
Not possible in the way you are requesting (keeping dynamic calculations)...

<that the user will be choose an excel file (can be 2003, 2007 or 2010 format). >
I assume you have a utility in Access to select the file in place already?

<It will open the excel file (which will calculate the fields with calculations), save it and close the file. and will dynamically link/import the data.>
Clearly define "dynamically link/import the data."?
Linking and Importing are two different things.


Whats the need for Access anyway? Why not keep this all in Excel?
Alternatively, ...why not move all of this to Access?

JeffCoachman
ASKER CERTIFIED SOLUTION
Avatar of Rahul Sehrawat
Rahul Sehrawat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Still not sure why Excel is needed, but if you have something that works, then roll with it...
Hi,

Then how will the user add his/her own fields. Also, how will be software calculate the fields with calculations.

If you see my access file, the reports which will be exported will also be dynamic. It will depend on the fields selected by the user.

I see this as the best thing I could do. :)
I see no reason why this all can't all be done in Access, ...

But again, if your solution works, the go with it.
I managed to solve the problem on my own.
Thanks