It looks like there is an excel bug that turns off num lock when multiple sendkeys are called. If your code is in a module or form then you can just add this to the module:
Private Declare Sub keybd_event Lib "user32" ( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
Private Const VK_NUMLOCK = &H90
Private Const KEYEVENTF_KEYUP = &H2
Declare Function GetKeyState Lib "user32.dll" (ByVal nVirtKey As Long) As Integer
Sub NUM_On() 'Turn NUM-Lock on
If Not (GetKeyState(vbKeyNumlock) = 1) Then
keybd_event VK_NUMLOCK, 1, 0, 0
keybd_event VK_NUMLOCK, 1, KEYEVENTF_KEYUP, 0
End If
End Sub
and then call Num_on from your sub like this:
Sub Tester()
With Application
Selection.Copy
Shell "notepad.exe", 3
SendKeys "^v"
SendKeys "^s"
SendKeys "C:\Users\MDIMAMUDDIN\Desktop\abc.txt" '<<==== Change
SendKeys "{ENTER}"
SendKeys "%fx"
VBA.AppActivate .Caption
.CutCopyMode = False
End With
Module1.NUM_On
End Sub
If your code is in the sheet code section, then you will have to create a module and place the code there (you can keep your tester sub where it is, but the other code needs to be in the module).