Macro copying from cells in Excel to text field in IE

ttbake

New Member
Joined
Sep 9, 2014
Messages
1
I am trying to form a macro that copies a range of cells from an excel worksheet to a text field in internet explorer. I am able to get the macro to navigate to the text field that I want my cells to be copied to and I am even able to get something to copy to the text field. However, the result is that the text box only gets the string "[object]" pasted into it.

Below are the relevant sections of code that I have (the rest of the code in my macro takes me to the webpage and sets up the data in the cells to be copied):

For i = 85 To 119
If Cells(i, 2).Value <> "" Then
Cells(j, 3).Value = Cells(i, 2).Value
j = j + 1
End If
Next i
K = "C85:C" & CStr(j - 1)
Range(K).Select
Selection.Copy
...
...
...
ie.document.All.Item("draftText").Value = Sheets("IYM Calculation").Range(K)

Does anyone have any advice or ideas on why this might not be working for me? Is this even possible?
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top