View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Close Referenced Workbook if it's No Longer Referenced

I don't think that you can do what you want to do. Excel will not
allow you to close a workbook (or xla) when another workbook has a
reference to that workbook or xla. Excel does some sort of reference
counting internally, but there is no programmatic access to that.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Thu, 18 Mar 2010 10:07:01 -0700, Ryan H
wrote:

Well since the add-in is considered "blind" to what workbooks are referencing
it, is there code that can count the workbooks that are currently referencing
the add-in? So if the count is 0 could I engineer so sort of code to close
the add-in? Hmmm

If this can't be done. Is there a way to make edits to the add-in workbook
(that is located on the server) while other workbooks are referencing it?

My problem is I update the add-in workbook when a user brings a bug to my
attention. If the user leaves the Excel application open and the add-in
workbook is not closed, Excel considers it as Read Only and I can't overwrite
the file. Is there a way to overwrite the .xla file when its being
referenced? Or do you have any other suggestions?

I basically have to depend on the sales team to close out Excel completely
in order to do any updates.

Thanks in advance,