Excel - embedded strings in formulaes

I have the following formula that retrieves data from another excel document.

='C:\Users\Username\Desktop\[Workbook1.xlsx]Sheet1'!$C$9

Workbook1 needs to be replaced with data from cell H2.
H2 could contain "Workbook2" or any other document name.

Thank you
jlbritAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
It's not possible to do what you are after if the referenced workbook is not already open. If it is open, you can use the INDIRECT function...

    =INDIRECT("'C:\Users\Username\Desktop\[" & H2 & ".xlsx]Sheet1'!$C$9")

Wayne

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rgonzo1971Commented:
HI,

pls try ( works only if the wbk is open)

=INDIRECT("''C:\Users\Username\Desktop\["&H2&".xlsx]Sheet1'!$c$9")

Regards
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
Another way is to create a Connection (under Data tab) in your Excel, so that it can linked to an external source (Excel).

Open or change source workbooks of external references (links)
https://support.office.com/en-ie/article/Open-or-change-source-workbooks-of-external-references-links-ae3e687c-97ae-4d9b-b684-8756a5301253

Once, you have created the Connection, click the "Existing Connections" button to show up the wizard to link to your external source.
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Rob HensonFinance AnalystCommented:
There is a downloadable add in called MoreFunc that gives a function INDIRECT.EXT which allows for closed workbooks.

I last used it in Excel 2003 so I don't know if it is compatible with later versions.

This link says it is compatible with 2007, 2010 and 2013 but 32 bit only.

http://download.cnet.com/Morefunc/3000-2077_4-10423159.html

Thanks
Rob H
jlbritAuthor Commented:
I need to collect the data while the document is closed and a data connection is not an option.

I've abandoned this project for now.

Thank you all for replying.
ThomasMcA2Commented:
What you are asking for can be done with VBA. It can read data from closed workbooks, and update formulas in another workbook. It could run automatically when any workbook is opened, or it could be triggered from the click of a button.

In other words, VBA can modify the formulas so they contain the values from H2. There are many options for how/when the VBA code would run.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.