Buttons on excel doesn't "click"

M

mfc

Hi,

I have a macro attached to a button on an excel spreadsheet. When I click on
it, it doesn't animate, i.e. it does not appear to go down and then come up.
But the macro does execute.

My macro is a long one, how can i make the button behave like normal one so
the user won't try to click it lots of times because it didn't appear to
work?

thanks
 
P

Peter Huang [MSFT]

Hi,

Based on my understanding, you put a Button onto the Excel Sheet directly
and attach an event handler function to its click event.
The function will do a long time job, so far at you side, the macro will
run, but the button did not have any UI change(e.g. Pressed Down and then
UP)

Based on my test, I can not reproduce the problem.
Here is my test steps.
1. Put a button onto the Excel WorkSheet
2. Attach Event handler
Private Sub CommandButton1_Click()
While True
Debug.Print "Hello"
Wend
End Sub
3. Set the Button in Run Mode
4. Click Button and the macro will keep running and now the button UI
status will Press Down and not UP, because the macro is a endless loop, it
never end, so the button never up.

You may have a try and let me know if there works for you.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi,

Did my suggestion help you?
If you have any concern, please feel free to let me know.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

mfc

hi,

I guess my problem is similar to your example. I tried your example, but on
my PC the button doesn't go down at all.

Even DoEvents doesn't make the button go down

Sub CommandButton1_Click()
DoEvents
While True
DoEvents
Debug.Print "Hello"
Wend
End Sub
 
P

Peter Huang [MSFT]

Hi,

So far I understand that although the code will running will you click the
button, but the the button will not have the UP/DOWN animation.
If so, we can assume the control in is running mode but not design mode.
The Design mode, I mean the time when we add the button onto the Excel
sheet, at that time, we can not press the button down and the code will not
running.

So I think you may try to disable all the COM addin and excel Addins and
restart the Excel. Now add a button, but not attach any macro to it.
Now if we exit the design mode, (there will be no 8 lilttle circle around
the button), will the button UP/DOWN UI working correct?

Please perform the test and let me know the result.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi,

I post to check if you have any other concern on this issue.
If so please feel free to post here.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top