Thread: VBE Issue
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Fiona[_4_] Fiona[_4_] is offline
external usenet poster
 
Posts: 9
Default VBE Issue

Hi Seth,

This stuff is way beyond me but if it helps, I noticed you are
creating 2 instances of a workbook,
1)Function RunQuery()As Workbook
2)Set Wkb = Workbooks.Add

you probably want the new copy of the workbook to stay open to work on
?
so you only want the first workbook opened to close ?

I would try "workbooks(1).close" right after the "RS.close"

If this doesn't help I hope it at least sets you off in the right
direction.