ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Nothing has changed but macros won't work!?! (https://www.excelbanter.com/excel-programming/323372-nothing-has-changed-but-macros-wont-work.html)

JFamilo

Nothing has changed but macros won't work!?!
 

I have written a few macros and sent them via a text file to a
colleague. She has used these macros on several of her files by
copying and pasting them into new modules. Once the macros are
operable for that workbook we send them on to other users, that way
they just need to click a button and it works.

This process has always worked well. But recently when she tries to
run the Macro there is always an error. It has something to do with
adding a button to a worksheet. It worked earlier and the code has NOT
changed. This has happened on several occasions. Is there something
unstable about macros that can be changed so they will always run
without fail!?

Thanks in advance.


--
JFamilo
------------------------------------------------------------------------
JFamilo's Profile: http://www.excelforum.com/member.php...o&userid=17276
View this thread: http://www.excelforum.com/showthread...hreadid=346085


JFamilo[_2_]

Nothing has changed but macros won't work!?!
 

In an update to this....after working on this for a long time and
restarting Excel, restarting the computer, retyping some code etc. we
finally figured out the problem.

If you are assigning a button to a macro in a file, for example:
Set btn = ActiveSheet.Buttons.Add(l, T, H, W)
btn.OnAction = "Tennessee Policies Aug-2004!macro2"

Make sure the filename doesn't have a "-" in it! That turned out to be
our problem


Hopefully I can save someone a lot of time with this.


--
JFamilo
------------------------------------------------------------------------
JFamilo's Profile: http://www.excelforum.com/member.php...o&userid=17276
View this thread: http://www.excelforum.com/showthread...hreadid=346085



All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com