+ Reply to Thread
Results 1 to 10 of 10

Please help with 'Argument Not Optional' error.

  1. #1
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Please help with 'Argument Not Optional' error.

    I've attached an example workbook that has a custom ribbon with one toggle button on it. The toggle simply 'shows' and 'hides' the formula bar when pressed. The callback in this example works perfect, but when I use the exact same toggle button and callback in my more extensive workbook, I get an 'Argument Not Optional' error. Can anyone explain why this works perfect in the example, but presents an error when used in another workbook. I've read where there is a way to make this optional, if so, how do I go about doing that? Thanks.
    Attached Files Attached Files
    Last edited by rkjudy; 06-08-2011 at 01:25 PM.

  2. #2
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Please help with 'Argument Not Optional' error.

    on what line do you get the error,, can you post the workbook at which the error occurs?

  3. #3
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Please help with 'Argument Not Optional' error.

    It doesn't take me to VB to debug the error. It just pops a message box saying 'Argument no optional' and when I click OK, it just goes away. Doesn't take me to VB or anything.

  4. #4
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Please help with 'Argument Not Optional' error.

    you could insert a break point and then navigate through the code until the error comes up,, then you can find on which line the error happens

  5. #5
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Please help with 'Argument Not Optional' error.

    I set a breakpoint on the first line of code (Application.ScreenUpdating) and I still got the same error. It's like it presents the error before it ever tries to run the CallBack. I would send the entire workbook but it is extremely large and somewhat confidential. Thanks for your help.

  6. #6
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Please help with 'Argument Not Optional' error.

    maybe the problem is in the customUI14.xml file which is used to make the custom Ribbon, maybe the call to the function doesn't include all the arguments.

  7. #7
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Please help with 'Argument Not Optional' error.

    Here is the XML code for the CallBack.

    Please Login or Register  to view this content.
    This code was taken from the workbook that presents the error. It's the very same CallBack used on the example workbook that I provided and works perfect.

  8. #8
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Please help with 'Argument Not Optional' error.

    well i couldn't tell what's wrong.. i don't see anything wrong with the xml file either..i need to see the original workbbok, try to change the Sub name as follows though:
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Please help with 'Argument Not Optional' error.

    I added the word 'Optional' as you said and I don't get the error. But, nothing happens. It doesn't set the state or anything. I've included the workbook (with all the code) that I'm trying to make this work on. The CallBack for this button is at the bottom of Module 3. I've removed some sheets, so most of the other ribbon buttons will not work. And by the way, if the formula bar is showing, clicking my Show/Hide Toolbar button will hide the toolbar, but it won't show it when clicked again. Thanks.
    See attached.
    Attached Files Attached Files
    Last edited by rkjudy; 06-08-2011 at 06:30 PM.

  10. #10
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Please help with 'Argument Not Optional' error.

    rkjudy,
    sorry for late reply.. i have modified your code for the formula bar show and hide.. please see if this solves your problem.
    Attached Files Attached Files
    Last edited by mohd9876; 06-09-2011 at 01:54 AM. Reason: uploaded the wrong file

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 4 users browsing this thread. (0 members and 4 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1