L
lisamariechemistry
Hi -
I'm trying to access data from a cell in a closed workbook, so I read
previous posts about it and started with a "simplest case" test, which
works fine:
debug.print ExecuteExcel4Macro("'c:\[TEST.xls]Sheet1'!R1C1")
'yields the value of cell A1
'with TEST.xls as a new workbook created by me - nothing done to it
except to add some text in cell A1
BUT: when i try it with the file I actually want to access, I
encounter problems...
debug.print ExecuteExcel4Macro("'c:\[SURR01.xls]Sheet1'!R1C1")
'yields Error 2023
However, if c:\SURR01.xls is open, ExecuteExcel4Macro does yield the
correct results.
I've triple and quadruple checked my syntax, looking for any typos,
and Sheet1 is definitely a sheet in the workbook. So: what else
could be different about this workbook to cause the error? It isn't
protected. It is generated by specialized software (HP CHEMSTATION)
but as far as I can tell is a normal (and fairly simple) excel
workbook, nothing but text in the cells.
If need be, I can easily write the program to open all the files to
access the data, but I'm thinking somebody out there knows the answer
to my mystery. Thanks! -Lisa
I'm trying to access data from a cell in a closed workbook, so I read
previous posts about it and started with a "simplest case" test, which
works fine:
debug.print ExecuteExcel4Macro("'c:\[TEST.xls]Sheet1'!R1C1")
'yields the value of cell A1
'with TEST.xls as a new workbook created by me - nothing done to it
except to add some text in cell A1
BUT: when i try it with the file I actually want to access, I
encounter problems...
debug.print ExecuteExcel4Macro("'c:\[SURR01.xls]Sheet1'!R1C1")
'yields Error 2023
However, if c:\SURR01.xls is open, ExecuteExcel4Macro does yield the
correct results.
I've triple and quadruple checked my syntax, looking for any typos,
and Sheet1 is definitely a sheet in the workbook. So: what else
could be different about this workbook to cause the error? It isn't
protected. It is generated by specialized software (HP CHEMSTATION)
but as far as I can tell is a normal (and fairly simple) excel
workbook, nothing but text in the cells.
If need be, I can easily write the program to open all the files to
access the data, but I'm thinking somebody out there knows the answer
to my mystery. Thanks! -Lisa