View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Yarik Yarik is offline
external usenet poster
 
Posts: 6
Default Old code in Excel add-in (.xla)?

Hi NickHK,

I am not sure I understand your question. What I mean is: when I look
into the binary .xla file of my add in, I see "shreds of old code"
(function names, string literals, etc.) - code that was there, in the
add-in's modules, some time ago but no longer is visible through the
VBA code editor.

Maybe an example could illustrate my problem better... Let's say, once
I had a code like this (in a module of the add-in):

Private Const TBL__SELLERS = "tSellers"
...
Public Function SellerAttrValue(AttrName as String) as Variant
...
sql = "select * from " & TBL_SELLERS & " blah-blah-blah"
...
End Function

Then, at some point I renamed the function and changed the value of the
constant. So the new version of code become looking like this:

Private Const TBL__SUPPLIERS = "tSuppliers"
...
Public Function SupplierAttrValue(AttrName as String) as Variant
...
sql = "select * from " & TBL_SUPPLIERS & " blah-blah-blah"
...
End Function

Now, the problem is that, when looking in the XLA file using binary
viewer, among all those gibberish binary symbols I still see such
things as "tSellers" (the old string literal used for a constant),
"SellerAttrValue" (old name of the function), etc. But when I use the
VBA editor, I do not see any of those things anymore. They are gone
from the code long time ago, but they still reside in the add-in's
file.

So it looks like Excel keeps some elements of the old code in the XLA
file (like in a source control repository of sorts). I want to get rid
of such "archived" code, but I do not know how.


NickHK wrote:
Yarik,
You mean you have the older macro sheet style code in your workbooks ?

NickHK