View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
fugazi48 fugazi48 is offline
external usenet poster
 
Posts: 30
Default Closing a workbook after it has opened another


It may be as simple as just reselecting that window in your code.

example:
windows("current.xls").activate

"belkingold" wrote:

OK, I have a schedulr task that opens an Excel workbook. This excel
workbook has some code in it (in the WorkBook module) that opens
another workbook and runs a script in the newly opened workbook. The
newly opened workbook closes itself fine, but then it seems the code
does not default back to the original workbook. What the heck is going
on? Is there something I am missing?

Scheduler opens workbook 1, workbook 1 opens workbook 2 and starts
script, script runs, workbook 2 closes, why won't workbook 1 close?

Jeff