View Single Post
  #14   Report Post  
Antonio Duarte
 
Posts: n/a
Default

Sorry! My fault!
I thought the problem was due the error returned by the Evaluate function
call, so when executing the code step by step (using the VBA debbuger), I
always stopped at that point. Now, reading your newest considerations, I
understood and let the code run freely. Result: everything runs fine!
I really appreciate your help and patience!
Thanks.

"Dave Peterson" escreveu:

One of the things that first: pull = Evaluate(xref) does is to check to see
what it evalates to. If it's not an error, then it evaluates ok and that means
the workbook is open.

If it returns an error, then the workbook is closed. I got error 2023 in my
tests with the workbook closed and this in the cell:

''C:\My Documents\excel\[Book2.xls]Sheet1'!$A$1

Note the first single quote is used to indicate that the cell is text. (Excel
will use this prefixcharacter and that first one isn't part of the value in the
cell.



Antonio Duarte wrote:

For sure I answered, and it was not the expected answer: even with the more
basic test, the call to the Evaluate function still behaves the same way.
Just note the following: the command line that calls the Evaluate is in the
first half of the code, BEFORE the CreateObject("Excel.Application") is
called (it is done only some lines below...).
Before calling the Evaluate, Harlan's code simply works on strings,
preparing the parameter 'xref' that will be used by Evaluate, and NOTHING
ELSE!
As reported before, 'pull = Evaluate(xref)' returns "Error 2023" or "Error
2015" (depending either the " ' " delimiter is used or not in the composition
of the xref parameter).
Any clue?
TKS!

<<snipped