简体   繁体   中英

Cell value with link to another workbook not updating

I noticed sometimes when I have a cell containing a link to another workbook, even if I enable Data Connection and Links, the value is just wrong until I actually open the source workbook!

I'm unsure under what circumstance this happens neither, just aware that this occasionally happens, and so makes me feel very unsecured.

Is anyone having the same trouble? And any idea how to fix/avoid this problem?

Many thanks!

Try being more specific:

Thisworkbook.Sheet1.Range("A1") = c.Range("C21")

Eventually you could also try this solution: http://spreadsheetpage.com/index.php/tip/a_vba_function_to_get_a_value_from_a_closed_file/

If you are just referencing a cell from a closed workbook, there would be no need to open the workbook. Formulas can get a cell's value from a closed workbook.

 Sub GetIt()
    Range("A1") = "='C:\Users\dmorrison\Downloads\[A.xlsx]Sheet1'!$C$21"
    Range("A1").Value = Range("A1").Value
End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM