Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: VBA - sendkey twice based on success?

ppz:

I was using sendkey to access Power Query and connect to SharePoint Folder. Everything was smooth until the Power Query Data Preview Dialog appears. How do I allow sendkey to continue after the dialog appears?


Option Explicit
Sub Button1_Click()

Dim spPath As String
Dim strkeys As String

spPath = "" 'SharePoint Link


strkeys = "%APNFO" & spPath & "{Enter}{TAB 4}{Enter}"
'stops at first{Enter}, {TAB 4}{Enter} for EDIT
Call SendKeys(strkeys)

End Sub

Update

Also tried to sendkey twice with True but same result, Stops at dialog.


Option Explicit
Sub Button1_Click()

Dim spPath As String
Dim strkeys As String
Dim strkeys2 As String

spPath = ""

'strkeys = "%APNFO" & spPath & "{Enter}{TAB 4}{Enter}" ' hot key for PQ
'Call SendKeys(Trim(strkeys)) 'ST%V{ENTER}") Trim() is used to remove additional spaces

strkeys = "%APNFO" & spPath & "{Enter}"
strkeys2 = "{TAB 4}{Enter}"
Call SendKeys(Trim(strkeys), True)
Call SendKeys(Trim(strkeys2), True)
Debug.Print strkeys2

End Sub



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: VBA - sendkey twice based on success?

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×