sendkey

G

Guest

Guest
excuse my english!!!

if sendkey allow to send key to active window as from keyboard, why using sendkeys as the bolow example (in a Excel module)

SendKeys "%F", True
SendKeys "{DOWN}", True
SendKeys "{ENTER}", True
SendKeys "ciao", True

the fourth row don't write ciao in the fileopen window?

I think but I'm not sure that active window is excel as for row number 1, 2 and 3; and it remain for row number 4 instead of open file windows.

Thank for your time.

Simone
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi,
about your question:
I had a problem like it but when I put this code before "sendkey", it worked. put this code before line 4:
''''''''''''''''''''''''
AppActivate Return_Value
SendKeys "ciao", True
'''''''''''''''''''''''''''
where "Return_Value" is a Double representing the program's task ID.("Shell", returns this ID,if successful)
also I think you want open a file. if it is true, why do you use Ctrl+O?
SendKeys "^{O}", True

Good Luck
Hamid :)
 
Upvote 0
This is a much better way to oen a file

Sub xcxcx()

ss = Application.GetOpenFilename("ciao (*.xls),*.xls")
MsgBox ss
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,014
Messages
6,122,697
Members
449,092
Latest member
snoom82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top