VBA Question
You have neglected to enclose the full paths in double quotes as you were shown
6/27/2011 posting by me.
See my earlier posting today.
Gord
On Thu, 30 Jun 2011 10:34:03 -0700 (PDT), carl wrote:
On Jun 27, 5:17*pm, isabelle wrote:
hi carl,
i hope that the correction made ??by Gord has solved your problem,
--
isabelle
Thanks. I did try this:
Sub test2()
Dim nRow As Integer, nColumn As Integer, n As Integer
Dim sDir As String
nRow = 5
For i = 1 To 3 'where 3 is the range of paths in Sheet1 A1:A3
'adjust as necessary
sDir = Range("A" & i)
n = n + 1
For nColumn = 1 To 5
Sheets(2).Cells(n, nColumn) = ExecuteExcel4Macro _
("'" & sDir & "[ORF.xlsx]ORF_Charge'!R" & nRow & "C" & nColumn &
"")
Next
Next
End Sub
So I've changed the file extension to xlsx.
My file paths is in sheet 1 A1:A3. Like this J:\Projects\ORF\Meeds\xlsx
\005\ORF.xls
When I run the macro I still get prompted with an explorer window
that look like I need to select a file. Tha window is pointed to my
local pc desktop.
|