Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Ghost code from User-defined Add-Ins

Hi all,

Something very weird is happening with my user-defined Add-In Excel
VBA modules.

I have a set of "common" routines (like CheckFileonDisk(),
getSortedRow() etc) that I put into a CommonMacros.xla file, and am
referencing them thru Tools-AddIns and Tools-References.

It used to be working fine, but past couple of days I am observing a
strange problem - and am experiencing what I call "ghost" code.

In the course of development (of my other main modules), I found some
bugs in one of the CommonMacros procedures, fixed them and also added
a new function procedure.

Everything seems to be fine except that it insists on executing some
code that I have commented out!!!!! (during bugfixing)

There are a few MsgBox statements that I put in the Add-In procedure
during the course of debugging, and commented them out later.
However many times I de-link and re-link the AddIn reference, it
always executes these (currently commented out) MsgBox statements.

I even tried adding some new statements at the beginning of the buggy
add-in procedure and put a breakpoint there. During execution, it
comes to the breakpoint, but skips the newly added statements entirely
and keeps displaying the (visibly commented out) MsgBox statements!!!

If I de-link the reference, re-link it again, save the changes and
execute my macro *without exiting Excel*, it is working fine (the
ghost code is not executed).

But if I restart Excel and my application, it appears again!!! My
surmise (could be wrong) is that my previous save of the newly created
Reference was silently ignored?

Overall, I would say that the problem seems to be that I cannot seem
to get a recompile done on my Add-In module and Excel somehow
"remembers" only the older version...

I have tried quick-and-dirty things like renaming files, copying them,
etc and nothing seems to work.

The xla file is not saved in any default directory (i didnt know what
was default at saving time).

Please help with any inputs....
My advance thanks for any & all help...

Thanks & Regards,
-feltra

PS: This is how I unlinked and re-linked the AddIn module.
a) remove the reference to the Add-in in the Tools-AddIns
(from both Excel and VBA Editor windows)
b) Save the changes
c) Exit Excel
d) Restart Excel
e) Tie in the addin code in Excel thru Tools-<AddIns
f) Tie in the addin code in VBA Editor thru Tools-References

PS2: If there's no solution in sight, my only recourse is to stop
using the Common Macros in an Add-In module and instead put the macros
in each and every application.... This is a most cumbersome,
inefficient and manually error prone method. Wish I could avoid
this...

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ghost code from User-defined Add-Ins feltra Excel Discussion (Misc queries) 1 July 6th 07 12:16 PM
"User-defined type not defined" message in Excel RW1946 Excel Discussion (Misc queries) 0 August 31st 05 12:14 PM
Workspace faux user-defined type not defined Chris S[_2_] Excel Programming 3 November 11th 04 05:51 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM
Word.Document - user defined type not defined jowatkins[_7_] Excel Programming 0 January 20th 04 08:46 AM


All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"