Run Time Error 424 - Object Required

Foynxter1

New Member
Joined
Sep 29, 2016
Messages
40
Hi, I hope that someone can help me.
I have taken a copy of some script to use in sending e-mails from Excel.
The subject of the e-mail will be the value of "topic" on the active row.
The code I have used is as follows - (top of the code only as it is quite long )

Sub TMS_request()
'
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Dim RangetoHTML As String
Dim cell As Range
Dim strbody As String
Dim emailRng As Range, cl As Range
Dim sTo As String
Dim ccRange As Range, cnt As Range
Dim cTo As String
Dim topic As String

topic = Range("X" & Target.Row)

Unfortunately I am getting the error
"Run time Error 424"
Object Required

Any assistance would be very welcome. Thanks
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi,
You have not declared your object variable "Target" & set a reference to it - n[FONT=&quot]o actual object is referred to until you use the [/FONT]Set[FONT=&quot] statement to assign the required range.

Replace Target.Row with [/FONT]
ActiveCell.Row & see if this solves your problem.[FONT=&quot]

Dave[/FONT]
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,536
Members
449,037
Latest member
tmmotairi

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