View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Close Dialog Box with SendKeys

the 2nd line was an example of how to use sendkeys
with a "dummy" dialog.

(normally you use sendkeys BEFORE opening the dialog..
Jim,

I can see what you want to do..
BUT I dont know an alternative approach to setting that value.
AND SENDKEYS is doomed to fail...

Just open that dialog yourself.
Select the 3rd tab.
Close the dialog.

Open the Dialog again..

See?... It's still on the 3rd tab.. but there's no way (without api's) to
tell which Tab is active. and the Tabs themselves have no accelerator...

Also IF the checkbox was already checked, your code will uncheck it..

FAIK the only alternative is complex code with API's to trap the dialog,
read the settings of the SysTabControl32 object.. etc etc.





keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


Jim May wrote:

It's still not working;
What does line two do?
Line 2: Application.Dialogs(xlDialogActiveCellFont).Show

Here is code at last attempt:

Sub ToggleSavePreviewPicture()
' Sends ALT+F to open the File menu.
SendKeys ("%f"), True
' Sends ALT+I to open the Properties dialog box and displays the
' Summary tab.
SendKeys ("i"), False
' Selects the Save Preview Picture check box.
SendKeys ("%v"), True
' Close Dialog Box
SendKeys ("%{F4}")
End Sub

Jim May

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!