Function in VBA

  • Thread starter Christopher Brooks
  • Start date
C

Christopher Brooks

When I write a function into any of the Excell objects in
VBA as follows:

Function Bird()
End Function

then type

=Bird()

into the spread sheet, it does not see the function.

When I debug the function, I get the following error
message:

Object library invalid or contains references to object
definitions that could not be found.

What is going on here? Isn't a function supposed to work
in the spreadsheet?

-cnb
 
K

keepITcool

'any of the excel objects' is crucial here...
these are 'object modules' and work differently from normal code modules

insert a standard module.
type or copy your code there

et voila!





keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
F

Frank Kabel

Hi Christopher
you have probably inserted this piece of code in a workbook or
worksheet module instead of a standard module
 
C

Christopher Brooks

-----Original Message-----
'any of the excel objects' is crucial here...
these are 'object modules' and work differently from normal code modules

insert a standard module.
type or copy your code there

et voila!

et voila, indeed! Thank you very much. I have the feeling
that I may be returning to this forum.

-cnb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top