LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Excel VBA Classes Error: 424 Object Required


Change
oSpread.Calculate(TheStrip)
to
oSpread.Calculate TheStrip

When you use parentheses around an argument to a Sub procedure, that
indicates to VBA that you want to evaluate the variable's value before
passing it, passing the value of the argument rather than the argument
itself.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)

"Sooty" wrote in message
ups.com...
Hi All,

I'm receiving the error 424:Object required when I try to pass a range
object to a method that I've defined for my own class object.

Class Module: Spread

Public Sub Calculate(ByRef TheStrip as Range)

' Done nothing

End Sub

Program Module: Main

Public Function Spreads(ByRef TheStrip as Range)

Dim oSpread as Spread
Set oSpread = New Spread
oSpread.Calculate(TheStrip) 'error occurs here!

End Function

Would appreciate any help.

Regards,
Paul.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Required error Patrick Simonds Excel Programming 3 August 26th 06 07:51 PM
Excel 2007 Beta 2 - Macro Run-time error '424' Object required jcm21 Excel Programming 0 June 16th 06 07:17 PM
Object required error broogle Excel Programming 7 March 21st 05 09:01 AM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM
error 424 - Object Required blb Excel Programming 0 October 1st 03 05:32 PM


All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"