Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / September 2006

Tip: Looking for answers? Try searching our database.

Run-time error 424, Object required

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
perldev@gmail.com - 28 Sep 2006 21:15 GMT
I have the following code:

sub foo()
   dim record as range
   set record = Range("A" & ActiveCell.row & ":K" & ActiveCell.row)

   record.select
   Upload(record)
end sub

public sub Upload(ByRef r as Range)
....
end sub

It keeps throwing out error: "run-time error 424, Object required",
what's wrong?

debug.print record.Address(external:=true)   shows:
[Junk.xls]Sheet1!$A$6:$K$6
Jim Thomlinson - 28 Sep 2006 21:23 GMT
Which line throws the error?
Signature

HTH...

Jim Thomlinson

> I have the following code:
>
[quoted text clipped - 15 lines]
> debug.print record.Address(external:=true)   shows:
> [Junk.xls]Sheet1!$A$6:$K$6
Bob Phillips - 28 Sep 2006 22:31 GMT
Sub foo()
   Dim record As Range
   Set record = Range("A" & ActiveCell.Row & ":K" & ActiveCell.Row)

   record.Select
   upload record
End Sub

Signature

HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

> I have the following code:
>
[quoted text clipped - 15 lines]
> debug.print record.Address(external:=true)   shows:
> [Junk.xls]Sheet1!$A$6:$K$6
perldev@gmail.com - 29 Sep 2006 12:59 GMT
The foo sub threw out the error.

Sub foo()
  ..
  On Error GoTo ErrorHandle
    Upload(record)
    exit sub
ErrorHandle:
    Msgbox "Something wrong with range", vbCritical
End Sub

It hit the msgbox.

> Sub foo()
>     Dim record As Range
[quoted text clipped - 30 lines]
> > debug.print record.Address(external:=true)   shows:
> > [Junk.xls]Sheet1!$A$6:$K$6
Dave Peterson - 29 Sep 2006 13:30 GMT
Bob's suggestion was to remove the () in:
Upload(record)
change this line to:
Upload record

You could also use:
Call Upload(record)

> The foo sub threw out the error.
>
[quoted text clipped - 43 lines]
> > > debug.print record.Address(external:=true)   shows:
> > > [Junk.xls]Sheet1!$A$6:$K$6

Signature

Dave Peterson

perldev@gmail.com - 29 Sep 2006 14:37 GMT
This worked!  Thank you Dave!

> Bob's suggestion was to remove the () in:
> Upload(record)
[quoted text clipped - 51 lines]
> > > > debug.print record.Address(external:=true)   shows:
> > > > [Junk.xls]Sheet1!$A$6:$K$6
Dave Peterson - 29 Sep 2006 16:10 GMT
That was Bob's suggestion--but I'm sure he's happy you got it working.

> This worked!  Thank you Dave!
>
[quoted text clipped - 57 lines]
> >
> > Dave Peterson

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.