ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   This one is WEIRD! (https://www.excelbanter.com/excel-programming/340250-one-weird.html)

schoujar[_12_]

This one is WEIRD!
 

Okay.

So I have a macro which runs by clicking on the "run" button in the
macro menu/toolbar.

And I have a button, which when clicked should call that macro.
But when clicking on the button vba finds an error in the macro, which
is NOT an error since the macro runs fine otherwise. So bloody
bizaare!

HELP!


--
schoujar
------------------------------------------------------------------------
schoujar's Profile: http://www.excelforum.com/member.php...o&userid=26574
View this thread: http://www.excelforum.com/showthread...hreadid=468127


Norman Jones

This one is WEIRD!
 
Hi Schoujar.

Post the contentious code.

Also, what is the reported error and which code line is highlighted ?


---
Regards,
Norman



"schoujar" wrote in
message ...

Okay.

So I have a macro which runs by clicking on the "run" button in the
macro menu/toolbar.

And I have a button, which when clicked should call that macro.
But when clicking on the button vba finds an error in the macro, which
is NOT an error since the macro runs fine otherwise. So bloody
bizaare!

HELP!


--
schoujar
------------------------------------------------------------------------
schoujar's Profile:
http://www.excelforum.com/member.php...o&userid=26574
View this thread: http://www.excelforum.com/showthread...hreadid=468127




Dave Peterson

This one is WEIRD!
 
Are you using xl97?

Are you trying to run the macro by clicking on a commandbutton from the control
toolbox toolbar (or a different control on that control toolbox toolbar)?

If yes, try manually changing the .takefocusonclick property to false for that
button/control.

If the control doesn't have that property, add:

activecell.activate

to the top of your code.

This bug was fixed in xl2k.



schoujar wrote:

Okay.

So I have a macro which runs by clicking on the "run" button in the
macro menu/toolbar.

And I have a button, which when clicked should call that macro.
But when clicking on the button vba finds an error in the macro, which
is NOT an error since the macro runs fine otherwise. So bloody
bizaare!

HELP!

--
schoujar
------------------------------------------------------------------------
schoujar's Profile: http://www.excelforum.com/member.php...o&userid=26574
View this thread: http://www.excelforum.com/showthread...hreadid=468127


--

Dave Peterson


All times are GMT +1. The time now is 07:43 PM.

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