Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default [HELP] closing a program with VBA code

Hello
I need help for closing an aplication in the end of an Excel Sub()
I tried the code:
-------------------------------------------------------------------
AppActivate "IML Device 1", False
SendKeys "%{F4}", False
DoEvents
AppActivate "IML Device 1", False
DoEvents
SendKeys "ENTER", False
DoEvents
--------------------------------------------------------------------

i will have to send the ALT+F4 command to close and then press "enter"
because it is one of those programs that ask if you "really whant to
close" ...
The problem is that the "ENTER" comand i send it's not making
anything...
The program remains with the question that "do you really what to
close" and does not close.
Any ideia for resolving this problem ?
I already made searches over the internet and i didn't find the
answer.

Thank You
Regards
André Palmela
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default [HELP] closing a program with VBA code

try putting all the keystrokes in one line. This should put them in the
keyboard buffer for that program and it will process them as it needs them.

AppActivate "IML Device 1", False
SendKeys "%{F4}~", False
DoEvents

--
Regards,
Tom Ogilvy


"Andr? Palmela" wrote in message
m...
Hello
I need help for closing an aplication in the end of an Excel Sub()
I tried the code:
-------------------------------------------------------------------
AppActivate "IML Device 1", False
SendKeys "%{F4}", False
DoEvents
AppActivate "IML Device 1", False
DoEvents
SendKeys "ENTER", False
DoEvents
--------------------------------------------------------------------

i will have to send the ALT+F4 command to close and then press "enter"
because it is one of those programs that ask if you "really whant to
close" ...
The problem is that the "ENTER" comand i send it's not making
anything...
The program remains with the question that "do you really what to
close" and does not close.
Any ideia for resolving this problem ?
I already made searches over the internet and i didn't find the
answer.

Thank You
Regards
André Palmela



Reply
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
Keeping program open even when closing workbook Bob Excel Discussion (Misc queries) 3 April 25th 08 07:55 PM
Excel program remains open after closing file RPC Excel Discussion (Misc queries) 9 February 7th 08 07:59 PM
How can I exit a workbook in Excel without closing the program? cosborn Excel Discussion (Misc queries) 1 September 21st 06 09:19 PM
How do I save personal menu bar settings when closing program othf1993 Setting up and Configuration of Excel 0 August 19th 06 08:41 AM
Need program to ask me to save changes when closing yar[_2_] Excel Programming 1 April 22nd 04 08:08 PM


All times are GMT +1. The time now is 10:24 AM.

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

About Us

"It's about Microsoft Excel"