The dreaded Sendkeys command

D

David Morton

Hi,

I have a very repetitive task I have to do sometime next week that
entails entering data into a form created by foxpro. Unfortunately, the
designer of the form did not design the form well, and is no longer with
the company, so the tab-order is incredibly out of whack and doesn't
seem to make any sense. Nevertheless, I am trying to automate the data
entry using Excel, but I have one problem. When I use the following
procedure:

Sub CheckIt()
AppActivate ("Microsoft Visual FoxPro")
SendKeys "{TAB}", True
End Sub

everything works great, but when I use the following:

Sub CheckIt()
AppActivate ("Microsoft Visual FoxPro")
SendKeys "+{TAB}", True
End Sub

Absolutely nothing happens. I can't seem to tab backwards, though
tabbing forwards isn't a problem. Any ideas on how to get this to work
better? If I can figure this little thing out, I can save myself a
couple of days of work.

Thanks in advance,

David Morton
 
K

Ken Macksey

Hi

I don't have foxpro to try it, but this worked for me in excel. I selected a
cell on the sheet so I could see what was happening. You may have to make
sure that the foxpro app is ready where it needs to be so that shift tab
moves to where you expect it.

Worksheets("sheet1").Range("c5").Select
SendKeys "+({tab})"

You may have to play with it a bit, but you could try just

SendKeys "+({tab})"


HTH

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top