pesky invalid external reference error: how to track it down?

M

Matthew Dodds

I have built an AddIn which charts the data on a particular worksheet.
The formula defining the chart series point to names on that same
worksheet and in which the data for charting are filed.

All is fine until I use my delete_all_charts function and immediately
close down Excel ... when I get the unlovely and untraceable "Your
formula contains an invalid external reference to a worksheet".

I do not know how to identify this errant formula. The error is
triggered after a Workbook_BeforeClose function I have on the AddIn,
and after a log file it generates has been saved, and so I guess it
relates to the closure of the workbook with the charted data.

How can I track down this formula? My delete all charts function first
uses chartobjects.delete and then systematically deletes all the names
that defined the charts (to do it the other way around i.e. the name
first, then the chartobjects, quite logically triggers the above error
msg). As far as I am aware my worksheet at that point does not HAVE any
formula remaining, so I'm somewhat stuck.

I have tried the findLink.xla that some have recommended but as the
error occurs on shutting down Excel I wasn't able to identify the
invalid reference formula.

Any ideas very gratefully received, this is getting me close to wits
end....

Thanks in advance

Matthew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top