Avatar of Rahul Sehrawat
Rahul Sehrawat
 asked on

Excel to Access Dynamic Linking


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.

Microsoft ExcelMicrosoft AccessVB Script

Avatar of undefined
Last Comment
Rahul Sehrawat

8/22/2022 - Mon

You can't directly write to a linked Excel file from Access.  Linked Excel files are read-only. See the following:

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.
Rahul Sehrawat

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.
Andy Marshall

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).
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Rahul Sehrawat


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.
Jeffrey Coachman


...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?

Rahul Sehrawat

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jeffrey Coachman

Still not sure why Excel is needed, but if you have something that works, then roll with it...
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Rahul Sehrawat


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. :)
Jeffrey Coachman

I see no reason why this all can't all be done in Access, ...

But again, if your solution works, the go with it.
Rahul Sehrawat

I managed to solve the problem on my own.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes