I use these lines to get values from closed workbooks:
Arg = "'" & Path & "[" & File & "]" & Sheet & "'!" & "R4C4"
Arg = CStr(Arg)
GetValue = ExecuteExcel4Macro(Arg)
Is there another way than loop to get values from a range? The loop solution is working, but it would be clearer if I could get the range directly with ExecuteExcel4Macro
. I've tried to input a range in Arg
, but it returns an error.
I have the same question for charts, how can I get them? My solution for the moment consists of getting values and replotting the charts. It works, but I would be happier with a GetChart(Chartname)
function.
I've seen that I can use ADODB connection to get value from closed workbooks. But it was a little too complex compared to ExecuteExcel4Macro
. Would it be easier to use ADODB connection in the case of range/charts?