Problem:
I am creating a form with a webbrowser as an object inside.
From a sheet in excell I want to copy information from several cells to the browser in my form. I have no specific destination in the browser form, as you can see in the code snippet I am tabing my way through the form using send key command. What is killing me is the Paste command, sendkeys "^V" does not work. Other then that the code is working as a charm. I just want to empty the clipboard in the active area in the browser thats it.....
My code example, I have commented out the trial and errors I have already done (Some of them are way off, but in desperation you try anything
)
Private Sub CommandButton1_Click()
'''''''''''''''''''
Dim NR
NR = WorksheetFunction.CountA(Columns("A:A"))
Dim SR
SR = 2
Do While SR < NR + 1
'''''''''''''''''''''''''''''''''''''''''''''''''''
Sheets("S1").Range("B" & SR).Copy
Me.WebBrowser1.SetFocus
SendKeys "{TAB}", True
'ActiveWindow.Activate
'Paste
'Paste True
'Call Paste.Execute
'SendKeys "^V", True
'SendKeys.KeyDown (Keys.ControlKey)
'SendKeys.KeyPress (Keys.v)
'SendKeys ("^V"), True
'Call Paste
Sheets("S1").Range("C" & SR).Copy
Me.WebBrowser1.SetFocus
SendKeys "{TAB}", True
'ActiveWindow.Activate
'Paste
'Paste True
'Call Paste.Execute
'SendKeys "^V", True
'SendKeys.KeyDown (Keys.ControlKey)
'SendKeys.KeyPress (Keys.v)
'SendKeys ("^V"), True
'Call Paste
SendKeys "{TAB}", True
SR = SR + 1
Loop
Finito:
End Sub
// Tim
I am creating a form with a webbrowser as an object inside.
From a sheet in excell I want to copy information from several cells to the browser in my form. I have no specific destination in the browser form, as you can see in the code snippet I am tabing my way through the form using send key command. What is killing me is the Paste command, sendkeys "^V" does not work. Other then that the code is working as a charm. I just want to empty the clipboard in the active area in the browser thats it.....
My code example, I have commented out the trial and errors I have already done (Some of them are way off, but in desperation you try anything

Private Sub CommandButton1_Click()
'''''''''''''''''''
Dim NR
NR = WorksheetFunction.CountA(Columns("A:A"))
Dim SR
SR = 2
Do While SR < NR + 1
'''''''''''''''''''''''''''''''''''''''''''''''''''
Sheets("S1").Range("B" & SR).Copy
Me.WebBrowser1.SetFocus
SendKeys "{TAB}", True
'ActiveWindow.Activate
'Paste
'Paste True
'Call Paste.Execute
'SendKeys "^V", True
'SendKeys.KeyDown (Keys.ControlKey)
'SendKeys.KeyPress (Keys.v)
'SendKeys ("^V"), True
'Call Paste
Sheets("S1").Range("C" & SR).Copy
Me.WebBrowser1.SetFocus
SendKeys "{TAB}", True
'ActiveWindow.Activate
'Paste
'Paste True
'Call Paste.Execute
'SendKeys "^V", True
'SendKeys.KeyDown (Keys.ControlKey)
'SendKeys.KeyPress (Keys.v)
'SendKeys ("^V"), True
'Call Paste
SendKeys "{TAB}", True
SR = SR + 1
Loop
Finito:
End Sub
// Tim