LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default What's the syntax error with this SendKeys code?

Why is it I can never understand the syntax mentioned in VBA Help?

I'm trying to use send keys at the moment and VBA help says as an example to
press Alt-F-X

Application.SendKeys("%fx")


So when I try and use Alt-F4 to exit WinAmp I type the code:

C:\Program Files\Winamp\winamp.exe.SendKeys("%{f4}")


and the moment I move to another line it comes up with the error message:
"Compile error: Expected: line number or statement or end of statement" and
it highlights the first "backslash \".

Judging from other code experts on this site have taught me, I would have
guessed "speach marks" should go around the path to the application, but that
doesn't work and VBA help doesn't suggest it.

Thanks in advance

Phil
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SendKeys syntax problem VBAvirgin New Users to Excel 2 January 4th 06 04:42 PM
variable not declared error & syntax error G. Beard Excel Programming 1 October 6th 05 09:16 PM
Syntax Error in VLOOKUP Code Ken Excel Programming 3 October 20th 04 05:50 PM
help with code/syntax Jay Baxter Excel Programming 0 February 26th 04 08:11 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 08:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"