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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

dmt32

Well-known Member
Joined
Jul 3, 2012
Messages
7,052
Office Version
  1. 2019
Platform
  1. Windows
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]
 

Foynxter1

New Member
Joined
Sep 29, 2016
Messages
40
Thanks Dave, will check it out when back in work and let you know. Thanks your help.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,262
Messages
5,769,099
Members
425,517
Latest member
cheechburger

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
Top