在其他工作簿中获取值/图表,而不打开它 [英] get value/charts in another workbooks without opening it

查看:105
本文介绍了在其他工作簿中获取值/图表,而不打开它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题很清楚。



我想将数据(&图表)从封闭的工作簿复制到我目前的(打开)工作簿。



通过单元格的名称,可以轻松创建两个工作簿之间的链接,但在打开关闭的工作簿之前,该值不会更新。如何在不打开工作簿的情况下轻松更新?



如何将其推广到图表?

解决方案

我终于使用了这些代码行

  Arg ='&路径& [&文件& ]&片材& ! &安培; R4C4'范围(Ref.Range(A1)。地址(,,xlR1C1))C 
'执行XLM宏
GetValue = ExecuteExcel4Macro(Arg)

更简单的一些循环。


The title is clear.

I want to copy data (& charts) from closed workbooks to my current (opened) workbook.

It is easy to create a link between two workbooks, with the name of the cell, but the value doesn't update until I open the closed workbook. How can I update it easily without opening the workbooks ?

How can I generalise this to charts ?

解决方案

I finally used these lines of code

Arg = "'" & Path & "[" & File & "]" & Sheet & "'!" & "R4C4" 'Range(Ref.Range("A1").Address(, , xlR1C1))C
     'Execute XLM macro
    GetValue = ExecuteExcel4Macro(Arg)

Way more simple with some loops.

这篇关于在其他工作簿中获取值/图表,而不打开它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆