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 / July 2006

Tip: Looking for answers? Try searching our database.

UDF How to record in Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Baker - 02 Jul 2006 22:56 GMT
Hi:
Someone has given me a UDF which is coded as follows::

Private Function WorkbookIsOpen(wbname) As Boolean
'   Returns TRUE if the workbook is open
   Dim x As Workbook
   On Error Resume Next
   Set x = Workbooks(wbname)
   If Err = 0 Then WorkbookIsOpen = True _
       Else WorkbookIsOpen = False
End Function

I want to implement this so that it can be called for a sp[eciofic workbook. I have
presently tucked it in the same area as the macros, but when I call it I get a errpr "Sub
of Funcvtion undefined". The call is corrfect, but somehow the function isn't being
excited.

Can some one give me a step by step outline of how I record a functions such as this?

Thanks

John Baker
Dave Peterson - 03 Jul 2006 01:19 GMT
Did you put it in a general module?

Are you calling that function from a sub in a different module?

If yes, remove the word Private from the Function definition statement.

Function WorkbookIsOpen(wbname) As Boolean

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

> Hi:
> Someone has given me a UDF which is coded as follows::
[quoted text clipped - 18 lines]
>
> John Baker

Signature

Dave Peterson

 
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.