Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
importing data from closed workbook
Hi,
I'm using below function to import data from a closed workbook : Sub GetValuesFromAClosedWorkbook(fPath As String, _ fName As String, sName, cellRange As String) With ActiveSheet.Range(cellRange) .FormulaArray = "='" & fPath & "\[" & fName & "]" _ & sName & "'!" & cellRange .Value = .Value End With End Sub I am now trying to assign the result directly to a variable, but the following fails : myvar=application.evaluate("''c:\Myworkbook[Mysheet]'!A1:Q250") Anyone got any ideas why , or a solution to the problem ? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
importing data from closed workbook
You need to have the workbook open for application.evaluate() to work.
lieven wrote: Hi, I'm using below function to import data from a closed workbook : Sub GetValuesFromAClosedWorkbook(fPath As String, _ fName As String, sName, cellRange As String) With ActiveSheet.Range(cellRange) .FormulaArray = "='" & fPath & "\[" & fName & "]" _ & sName & "'!" & cellRange .Value = .Value End With End Sub I am now trying to assign the result directly to a variable, but the following fails : myvar=application.evaluate("''c:\Myworkbook[Mysheet]'!A1:Q250") Anyone got any ideas why , or a solution to the problem ? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing data from multiple closed workbooks | Excel Programming | |||
Help importing data from a closed workbook | Excel Programming | |||
add data to a closed workbook | Excel Programming | |||
getting data from closed workbook | Excel Programming | |||
getting data from closed workbook | Excel Programming |