View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JbL JbL is offline
external usenet poster
 
Posts: 17
Default VBA Code works by stepping through, not by running

for some reason the line

Workbooks(dataBk).Activate

does not switch between books so the variables don't pick up their proper
values. Any clues? (the book is open, it just won't switch to it)


"JbL" wrote:

Hi,

I have a macro that opens a file, reads data and performs calculations and
returns the results to a main sheet. I run through monthly files for several
years. I have been running a similar process w/o incident. For some reason
my code returns results if I Step through via F8, but not if I let it run
full steam. I get back zilch. I'm no expert, but can someone explain to me
why whatever variable assignment I have works at the slow speed but not at
normal speed? I'm really stumped since I've done similar actions many times
over and the core part of the code is the same?