View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Len B Len B is offline
external usenet poster
 
Posts: 18
Default Single stepping gives different result

I have a situation where I want to open a different workbook and go to the
next available row and paste some data there from the calling workbook.

The following code works if I single step through it but not if it runs in
real time. Why is that? Is there a better way to achieve what I am after?

In real time it just opens the workbook to where it was last saved - a
different sheet altogether and it doesn't select A21 in that sheet either.
So that's 2 statements that do not execute in real time.

If Not WBIsOpen(stExportBook) Then ' workbook isn't open so
Workbooks.Open stExportFull, 0 ' so open it without updates
Sheets("Capital Work (CAPEX)").Select
Range("A21").Select
End If

TIA
--
Len
__________________________________________________ ____