Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 12th, 2006, 03:53 PM
Registered User
Join Date: May 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to coyotworks
Default mysterious error runtime error '451'

Does anyone have any ideas about the following error?

"Runtime error '451':

 Property let procedure not defined and property get procedure did
 not return an object."

I get this in message in a popup when I call a function on a custom class. The function is supposed to return a boolean value if the code it contains executed successfully. It is used in a manner similar to the following:

'Calling code

Dim myClassInstance as myClass
Dim success as boolean

set myClassInstance = new myClass
success = myClassInstance.SomeFunction 'NOTE: Here is where the debugger takes me

'In the class module

'Class declaration
Public Function SomeFunction()
     functionOK = False
     if (test = True) then
          functionOK = True
     end if
     SomeFunction = functionOK
End Function

Why do I get this error upon calling a function (not a Property)? I've googled, but found only one reference to the same code in reference to a C++ project. One site indicates that error '451' means 'Object not a Collection'.

Thanks for any suggestions,


"It is better to light a candle than to curse the darkness."  -Chinese proverb
Reply With Quote
  #2 (permalink)  
Old May 12th, 2006, 03:57 PM
Friend of Wrox
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts

Try changing the Function declaration to...

Public Function SomeFunction() As Boolean

That way VBA knows what the return type will be. There may be other things causing this error, but I would try that first.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
hi i got runtime error 13 Type Mismatch error sriharsha345 Access VBA 2 February 21st, 2008 09:30 AM
runtime error dhoward VB.NET 2002/2003 Basics 2 November 1st, 2007 03:30 PM
runtime error??? jeffreyJS ASP.NET 2.0 Basics 4 September 14th, 2006 04:07 AM
Runtime Error whiterainbow ASP.NET 2.0 Professional 2 September 12th, 2006 01:20 AM
Runtime Error rwiethorn ASP.NET 1.0 and 1.1 Basics 1 January 27th, 2004 02:01 PM

All times are GMT -4. The time now is 01:25 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.