Results 1 to 4 of 4

Thread: VB Argument not optional" function return"

  1. #1
    Join Date
    Feb 2009

    VB Argument not optional" function return"

    I have application where I need to a put a function in my class that should returns an object of type card. Am trying to develop an application but when I try to run in VB It complains with the following message:

    "Only public user-defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types."

    What does this error message is showing on my VB project. This is the first time I am trying this kind of Project on my own. Does anyone before come across this kind of error message.

  2. #2
    Join Date
    Jan 2009

    Re: VB Argument not optional" function return"

    Add a regular module to your VB/VBA project, Despite (or, perhaps, in virtue of) its simplicity, diagnostic output remains a useful debugging tool. In languages such as Perl this was, for a while, the only debugging tool. Copy and paste the code in this article into the module, Call the functions from other Functions or Subs in your code, or if you are adding these functions to an Excel function, use the functions in worksheet array formulas.

  3. #3
    Join Date
    Dec 2008

    Re: VB Argument not optional" function return"

    By default these are modal, i.e. they interrupt the execution of the program. Message boxes also require the programmer to press the "OK" button, which can seriously slow down debugging. I tried using =CountByColorIF(Range("C14:C1399"), -4105, True) but I have not gotten it to work. I no longer get an error message in the VB code when the formula calcuates but the formula returns #VALUE!. VBA Editor has a fully functional integrated debugger, yet it does not obviate the need for diagnostic output.

  4. #4
    Join Date
    Mar 2008

    Re: VB Argument not optional" function return"

    Hiding the VBE Editor via Application.VBE.MainWindow.Visible may improve the performance in some cases. On the two worksheets, change the values in the parameter cells at the top of the worksheets, and see how the amortization schedules adjust. presumably the range that contains cells that we want to sum. Every argument has a data type (this one is Range) and the function itself has a data type. Setting Application. Calculation controls the recalculation of the cells while executing code. Setting it to false should speed up the execution of the code that changes the cell values.

Similar Threads

  1. Replies: 7
    Last Post: 18-02-2012, 03:19 PM
  2. Replies: 3
    Last Post: 06-03-2011, 06:26 AM
  3. Replies: 3
    Last Post: 30-07-2009, 08:40 PM
  4. Replies: 3
    Last Post: 02-06-2009, 11:09 AM
  5. Replies: 14
    Last Post: 13-07-2005, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts