PDA

View Full Version : Solved: This workbook is referenced by another ...



Cyberdude
08-21-2006, 11:51 AM
Something strange has happened and I'm not sure what. I first noticed that in my macro code whereever I have ".Name" the "N" is now in lowercase instead of uppercase. It doesn't seem to keep the code from working, but it seemed odd that all of a sudden the VBE isn't capitalizing the "N".

Now when I try to close Excel, I always get the message "This workbook is referenced by another workbook and cannot be closed." Then when I click the "X" in the upper right corner to close Excel, it closes! At that time there are no other workbooks open except Personal.xls. I did a search of Personal.xls and couldn't find any links in the macros or the worksheets, and there are no links listed in the Edit Links list.

Then I checked the References list and didn't see anything out of the ordinary checked.

And every so often when I invoke the compiler in the VBE (I use it to find unexpected errors) I'll get an error in a macro in Personal.xls at a point where I'm using the "Left" function. It says it can't find the function. I checked the references list, and found "funcres" was not checked. I have no idea what's in funcres, but I checked it and the error message stopped occurring.

Does anyone have any idea what this is all about? :banghead:

Zack Barresse
08-21-2006, 01:04 PM
funcres is the Analysis Toolpak addin. It shouldn't be referenced by anything. If you want to reference something, it should be the (after it's installed) the Analysis Toolpak VBA (ATPVBAEN.XLA) - EN is for English, substitute for language where applicable.

To get your "N" back to uppercase in "Name", type this anywhere, then delete it...

Sub Name()
End Sub

Sometimes people name variables as property names and Excel gets 'confused' with the case sensitivity.

Cyberdude
08-21-2006, 01:38 PM
Thanks, Zack. I always wondered about funcres. I'll uncheck it since I have ATPVBAEN.XLA checked. I'll try Sub Name ... now that's weird!

Is there any chance that the "workbook is referenced ..." message is somehow connected with declared Public variables?

Zack Barresse
08-21-2006, 01:55 PM
No, generally it's a reference to Personal.xls, which you shouldn't really do; at least I don't see the need for it. It would be in Tools | References.

Cyberdude
08-21-2006, 07:37 PM
Well, as a result of my tinkering I have successfully eliminated the annoying message that is the subject of this thread. Thanks to Zack's "Sub Name" I now have uppercase "N's" on my ".Name" occurrences. So all's well again. Thanks for your help ... let's mark this "SOLVED" (if I could).:mbounce: