Masta
New Member
- Joined
- Feb 22, 2022
- Messages
- 33
- Office Version
- 2021
- 2019
- 2016
- Platform
- Windows
I have a problem that I want to solve and I have succeeded to some extent. I coded a couple of lines, but I didn't succeed in the idea of realizing it to the end. I want to copy the data from the Address field to another application I'm working on when I click in the provided TextBox1 in that application after 2 seconds and then in the next TextBox2 after 2 seconds and so on. I hope you come up with an idea. This solution of mine only works for one field of TextBox copy/paste in another application. I have a total of 4 TextBox. Thank you.
Private Sub CommandButton126_Click()
'TextBox10.SetFocus
'Application.SendKeys "^A"
'Application.SendKeys "^C"
With New MSForms.DataObject 'For copy just another way
.SetText TextBox10.Text
.PutInClipboard
End With
Dim Shex As Object
Set Shex = CreateObject("Shell.Application")
tgtfile = "C:\Users\Masta\Desktop\test\something.url"
Shex.Open (tgtfile)
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "^V"
ActiveWindow.WindowState = xlMinimized
End Sub
Private Sub CommandButton126_Click()
'TextBox10.SetFocus
'Application.SendKeys "^A"
'Application.SendKeys "^C"
With New MSForms.DataObject 'For copy just another way
.SetText TextBox10.Text
.PutInClipboard
End With
Dim Shex As Object
Set Shex = CreateObject("Shell.Application")
tgtfile = "C:\Users\Masta\Desktop\test\something.url"
Shex.Open (tgtfile)
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "^V"
ActiveWindow.WindowState = xlMinimized
End Sub