Full Version: macro "attached" to file in EXCEL
UtterAccess Discussion Forums > Microsoft® Access > Access Macros
ironwood9
I noticed that when I run my macro procs a certain EXCEL file was opening upon invoking the macro. When I deleted that file, my macros wouldn't run - I recreated the file in EXCEL with the same name, and that is a temporary work around, but when I edit my macros, the list has all my procedures, plus the same macro names with the name of that particular EXCEL file.

Has anyone experienced this ? what's the fix ?

Thanks !
Steve
Ieaiaio
Are you talking about Personal.xls? Personal.xls is the personal macro workbook and it stores all the macros, UDFs, and VBA code you want to keep resident in Excel across workbooks. It needs to be open to run your macros, but it's usually hidden. If it's accidentally showing up as a regular worksheet, open it and go to Window -> Hide. Personal.xls is normally not a security issue as long as you're the one who wrote the code in it (or recorded the macro). Go to the VBE editor (Alt-F11) to check what's in it.

On the other hand, if it isn't Personal.xls, I'm confused. You may have some kind of macro virus, and you should definitely open up the VBE and give us some details about what you see.
ironwood9
The file was not PERSONAL.xls
Let's say it's called 2004_Financial_analysis.xls

Some more details - I open EXCEL - I go into macro editor - all I see is:
QUOTE
personal.xls!mcrFormatCells
personal.xls!mcrMain
personal.xls!mcrRowHeight


When I run a macro, it opens the 2004_Financial_analysis.xls file, and when I later go into macro editor, it looks something like this:
QUOTE
2004_Financial_analysis.xls!mcrFormatCells
personal.xls!mcrFormatCells
2004_Financial_analysis.xls!mcrMain
personal.xls!mcrMain
2004_Financial_analysis.xls!mcrRowHeight
personal.xls!mcrRowHeight


maybe more clear now...

Steve
KingMartin
Steve,

you have obviously the same module (macros, code, subroutines) in both Personal.xls and 2004_Financial_analysis.xls files.

I guess only one of the workbooks should contain the codes. Open VBE and delete the module from the unwanted one. You may want to confirm 'Export' in the dialogue that appears on deleting - just to be sure you do not lose your code.

personal = the codes are available all the time when you open Excel
specific file = the code is related to this particular workbook

Choose what's appropriate.

regards,
frown.gif
martin
ironwood9
Martin - thanks for taking the time to reply - I did what you said - deleted all the modules under the 'other file' (Not PERSONAL.xls) and exported them, and everything worked exactly the same way as before.

But thanks anyways...

Steve
KingMartin
Strange,

you deleted the modules with the macros and the names stayed? meaning the modules were still there?

There's a slight possibility that the Personal.xls workbook has a workbook_open event that copies the modules into other workbook, but I can't believe that. Check the Personal.xls modules in the VB Editor.

What is the code there doing, if any?

Martin
ironwood9
Martin, I think the problem is solved - I guess it went away when I re-booted - woo hoo !

Thanks !

Steve
KingMartin
You're welcome Steve.

Glad you got rid of the 'bug'. frown.gif

M.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.