Second instance of Excel

  • Thread starter Thread starter Dom
  • Start date Start date
D

Dom

I use something like the following in VB:

dim x as Excel.application
set x = excel.application
x.Visible = true
[... use x ...]
call x.quit
set x = nothing

This works fine, but just for the first time. When I call
it again, Excel starts up, but I only get the window frame
and the caption. The client area in transparent.

Can someone tell me what I am doing wrong? I'd appreciate
if responses were sent to my email address, because I
don't come here often. (e-mail address removed)

Dom
 
sounds like you still have a reference to Excel in your code. This could be
created inadvertenly because you don't fully qualify your reference. For
example

x.ActiveCell.Sort Key1:=Range("A1")

the Range("A1") is not qualified from x and creates a "ghost" reference
which can not be released.
 
Back
Top