ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pesky invalid external reference error: how to track it down? (https://www.excelbanter.com/excel-programming/377619-pesky-invalid-external-reference-error-how-track-down.html)

Matthew Dodds

pesky invalid external reference error: how to track it down?
 
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



All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com