Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

missing code still being executed? 1

Status
Not open for further replies.

KellyK

Programmer
Mar 28, 2002
212
US
Hi all, I am experiencing a bizarre problem that could be a symptom of my ignorance in using Excel VBA. I recently developed an Excel app that uses different functions and constants that I have saved in the VBA under "Module1". The business users requested some modifications, so I opened the existing Excel app and Saved As: Version 2. I modified Module1 in Version 2 to account for these changes, tested and sent it off to the business. Turns out my changes did not work exactly as they had anticipated, so I returned to Version 2 to make some modifications to the functions in Module1. Suddenly, Module1 is not in the Visual Basic window, ANYWHERE! What's even odder is that the app still "works," as in, it is still calling those functions and coming back with valid values. Is the tool somehow referencing the "old" Excel app to get Module1? When I look at cells within the document, there are no references to any other workbook, the cells call the functions directly. If I do a Find: on the VB window, I cannot locate any of the functions (with "Entire Project" checked). Since I do have Module1 in my Version 1 of the .xls, I can copy and paste it into Version 2 and make necessary changes, however I don't want to lose the updates I've made nor do I want this problem to come up again. Can anyone shed some light on this?

Thanks,

Kelly
 





Hi,

"...with "Entire Project" checked..."

There is no "Entire Project".

There is "Current Project".


What do you see in the Project Explorer?



Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Just to expand on Skip's point, in the Project explorer, under the current project (something like "VBA Project (Book 1)") there's a "tree" structure that lists "this workbook", "sheet1", <other sheets>, and it should/might have "Module1". It could be that the code window is closed but the module is still there. In that case, double-click the module in the tree and voila.

_________________
Bob Rashkin
 
Bob, you are a genius. Thank you! I was used to Module1 coming up under the menu item "Window", so I was confused about it not being there. I found it through the Project Explorer as you & Skip recommended.

And yes, of course I meant "Current Project". Sorry for the error.

Kelly
 
Skip's the genius; I'm just the translator.

_________________
Bob Rashkin
 




"I dream of genius, with the light brown hair..."

Sorry, I HAD dark brown hair. I don't qualify! ;-)

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top