Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
DisplayAlerts = False for open file diaglog window in VBA

But I would like to ask answer yes in one open file dialog windows because the message is important to me that
is related to answer file format question, I need to answer yes, and So I try to use sendkeys "{enter}" or {%Y}"
but it didn't work because the dialog window is on-hold until I click the button and so operation right is back to VBA editor ,
Any method could reply yes for the dialog window by vba coding automatically
Workbooks.Open Filename:=workbookname2
Sleep (500) 'Hang up here because need to click a reply button in diaglog bix
SendKeys "{enter}" or "{%Y}"
Please advise
Duncan
Now I understood after repeat to read your eamil, it works fine now after I put sendkey code in dowork(0
Sub filestest()
startwork
Workbooks.Open Filename:="junk.htm"
Enb Sub
Public Sub DoWork(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
StopWork '// disable repeated calls
Sleep (500)
SendKeys "{enter}" or "{%Y}"
'// Add code to do work.
Debug.Print "DoWork"
End Sub
Now I understood after repeat to read your eamil, it works fine now after I put sendkey code in dowork(0
Sub filestest()
startwork
Workbooks.Open Filename:="junk.htm"
Enb Sub
Public Sub DoWork(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
StopWork '// disable repeated calls
Sleep (500)
SendKeys "{enter}" or "{%Y}"
'// Add code to do work.
Debug.Print "DoWork"
End Sub
Now I understood after repeat to read your eamil, it works fine now after I put sendkey code in dowork(0
Sub filestest()
startwork
Workbooks.Open Filename:="junk.htm"
Enb Sub
Public Sub DoWork(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
StopWork '// disable repeated calls
Sleep (500)
SendKeys "{enter}" or "{%Y}"
'// Add code to do work.
Debug.Print "DoWork"
End Sub
Now I understood after repeat to read your eamil, it works fine now after I put sendkey code in dowork(0
Sub filestest()
startwork
Workbooks.Open Filename:="junk.htm"
Enb Sub
Public Sub DoWork(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
StopWork '// disable repeated calls
Sleep (500)
SendKeys "{enter}" or "{%Y}"
'// Add code to do work.
Debug.Print "DoWork"
End Sub
Now I understood after repeat to read your eamil, it works fine now after I put sendkey code in dowork(0
Sub filestest()
startwork
Workbooks.Open Filename:="junk.htm"
Enb Sub
Public Sub DoWork(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
StopWork '// disable repeated calls
Sleep (500)
SendKeys "{enter}" or "{%Y}"
'// Add code to do work.
Debug.Print "DoWork"
End Sub
Now I understood after repeat to read your eamil, it works fine now after I put sendkey code in dowork(0
Sub filestest()
startwork
Workbooks.Open Filename:="junk.htm"
Enb Sub
Public Sub DoWork(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
StopWork '// disable repeated calls
Sleep (500)
SendKeys "{enter}" or "{%Y}"
'// Add code to do work.
Debug.Print "DoWork"
End Sub
Now I understood after repeat to read your eamil, it works fine now after I put sendkey code in dowork(0
Sub filestest()
startwork
Workbooks.Open Filename:="junk.htm"
Enb Sub
Public Sub DoWork(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
StopWork '// disable repeated calls
Sleep (500)
SendKeys "{enter}" or "{%Y}"
'// Add code to do work.
Debug.Print "DoWork"
End Sub