View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
external usenet poster
 
Posts: 595
Default Late Binding issues when closing workbooks

HeatherO wrote:
Hi Dick,
I can post the code unfortunately it is rather big.


So I see.


On Error Resume Next
Set AppXL = CreateObject("Excel.application")


You shouldn't leave this On Error active for the whole sub. Just use it
when you need it. You may be masking errors.

Sub switch_form(varfname)


I don't see where you quit the Excel App in this sub. Obviously I don't
understand everything that's happening here, but it just seemed like it
should be here.

If you want to find the problem, you can step through the code with the Task
Manager open. After every line, count the Excel instances in the TM. If
there's one more than you expect, that's the line with the unqualified
reference that's creating the orphaned instance. I realize that it will
take a week to do that, but I don't know how else you'd find it.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com