On Mon, 13 Oct 2008 06:59:31 -0500, Dave Peterson
wrote:
Dave,
So if you make a typing mistake and mistype one of the variable names,
then your code won't even compile. If I were you I'd always use it.
With my poor typing skills a good suggestion.
Fourth (and it's just a guess since it doesn't explain the problem with the
local "sending" file)--maybe there's a network delay.
I've wondered about a network issue as well, but the problem remaining
with the local file is confusing. I'm going to concentrate on the
local file and see if I canfix it then try the network file. BTW, my
simplified code to experiment with has a message box asking if I want
local or network source and I select the path varialbe accordingly,
all the rest of the code is identical (and yes, I did check the
apostrophe!)
It's almost like the first time through the loop excel catches the
error and then says, oh, I knlw what you mean and works OK after that.
Another piece of data for anyone's consideration:
The original code actualy reads data from two different network files
(for comparison using later code, which all works great at this
point!) usig the same process to download the data, just different
path, etc. The behavior of the orginal code is:
1) open file
2) run macro
3) get error on first attempt to download from first file
4) run macro again, successfully download data from first file but get
error message on second file
5) run macro again and all data is downloaded and processing of info
proceeds successfully
6) at this point edits/changes can be made to the code and rerunning
the macro continues to work perfectly
Maybe you could add:
application.calculate '.calculatefull 'depending on your version
before you convert the range to values.
Or even do an edit|replace in that range:
change = to =
to see if excel will recalc.
I'll try these tonight (bummer I have to go to work soon). I've also
thought about trapping on the error and then entering the loop but I
haven't succeeded with that process yet.
If that doesn't work, I think I'd open the "sending" file and just copy|paste
values--or build a formula to the cells in the open file. (Depending on how
many of those formulas you're building, this may even work more quickly.)
My very first version of a workbook to compare the data between the
two network files did have a formula in every necessary cell to read
the data and then a macro was started to do the analysis. But the
opportunity to all the work in a macro was very attractive to me for a
lot of reasons (not the least of which is this is a huge learning
opportunity).
Thank you for continuing to follow up with me!
John Keith