Solved Excel Macro - Find & Replace - Problem NUL LOCKS shuts off

Dell / Inspiron 620
June 19, 2016 at 16:43:47
Specs: Windows 64, 2.901 GHz / 8104 MB
The macro for opening the F&R box works but there is a minor flaw that I can't figure out.

When you run the macro, it shuts off the NUM LOCK key on the keyboard number pad.

I have tried three different version of the Application.CommandBars and they all do it.

The three commands are:

'Application.CommandBars("Edit").Controls("Find...").Execute
'Application.CommandBars.FindControl(ID:=1849).Execute
Application.CommandBars.FindControl(ID:=313).Execute

They all work, but they all shut off the NUM LOCK.

I do not think it is the Application.SendKeys that are causing the problem,
but I don't know.

Any one have any ideas?

The full MACRO is:

' Open the Extended Options for Find & Replace
'
Private Sub Workbook_Open()

'Application.CommandBars("Edit").Controls("Find...").Execute
'Application.CommandBars.FindControl(ID:=1849).Execute
Application.CommandBars.FindControl(ID:=313).Execute
Application.SendKeys ("%+t")
Application.SendKeys "{Esc}"

End Sub

MIKE

http://www.skeptic.com/

message edited by mmcconaghy


See More: Excel Macro - Find & Replace - Problem NUL LOCKS shuts off

Report •


#1
June 19, 2016 at 17:28:23
✔ Best Answer

Report •

#2
June 19, 2016 at 17:58:37
Thanks DerbyDad, adding the DoEvents solved the problem.

Your still the VBA Master. :-)

MIKE

http://www.skeptic.com/


Report •

Related Solutions


Ask Question