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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 97 Macros - Changing by themselves

Status
Not open for further replies.

MortaR

Technical User
Mar 9, 2003
19
AU
I have created a couple of excel macros for a client of mine, and they are named e.g. Macro1 & Macro2.

These macros for instance, select all text, resize to a specific font, change certain cells etc.

Now every once in a while, when the macro is executed, a document that the user has recently opened will open behind the current sheet.

When I open the macro list and click on Macro1, instead of the macro linking to the following:

Macro1

it has the following text for example:

'reconciliation-balance.xls'Macro1

I keep telling the user that it's something they're doing but I can't work out exactly how they're doing it. And i'm not sure if theres a bug on the computer etc.

Any ideas?
 
Let's see your code. She may be running the macro on a file that does not have focus. You may have written the code to only work in "this file"...?

I also would NEVER leave a macro named as Macro1 or 2 or whatever...just 'cause a user might *play* with VBA and those are macro names THEY'll already have in use maybe...

Sounds to me like she's renamed the file you sent her to "recreation balance" and is trying to run the code on another file...

Anne Troy
 
The code doesn't really seem to be important as it never changes, only the button to the link to the macro really.. Sorry I should've specified.
I have created a button on the toolbar linking to the macro and for some reason that changes from "Macro1" to "'filename'Macro1" and opens whatever file name is listed.

The user of this computer does not really know much at all about Macros, and has informed me that she would not know how to change it even if she did want to. The only thing i've shown her is to click the button on the toolbar.

They aren't named Macro1 & Macro2 that was just as an example, one is called Format and the other AutoComplete

Hope this helps a little more.

Thanks
 
mmm good point that might be the key.. they're stored in the PERSONAL.XLS, the global macro storage i'm assuming..
This often opens up at random in it's own window after running the macro.
Could this have anything to do with it?
Soon upgrading to Office XP so I know that will remove a lot of problems but for the time being until that day comes a solution would be good! =)

Thanks
 
Personal.xls is ALWAYS open in Excel, if one exists in the XLSTART directory. However, it should be a HIDDEN file...

XP won't remove any of these problems!!
If I were you (seriously), I would post a new question titled "How does Personal.xls work?" And then go on to tell them what your macro does, whether it should work in any *active workbook* or only in *this file*, etc.

For your client...have her open Excel. Have her close the file that appears. See if personal.xls is open and hidden (gray screen, but personal.xls is in the title bar), or if she can SEE the personal.xls workbook in front of her (i.e., regular worksheet). If she can SEE her personal.xls, then have her go to Window-Hide. Then she should CLOSE Excel. She'll be asked if she wants to save personal.xls and she should say YES. That problem of her *seeing* personal.xls should go away.

Hope this helps!!

Anne Troy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top