+ Reply to Thread
Results 1 to 2 of 2

Excel XP error message Run Time Error 91

  1. #1
    Lenny
    Guest

    Excel XP error message Run Time Error 91

    When executing the following code.

    Dim WkbName As String

    WkbName = Application.CommandBars.ActionControl.Parameter
    If WkbName = "" Or WkbName = "ThisWorkbook" Then WkbName = ThisWorkbook.Name

    I get the following error message

    Run-time error '91':
    Object variable or With block variable not set

    COuld someone please help me correct the problem or help me with the syntax



  2. #2
    Bob
    Guest

    RE: Excel XP error message Run Time Error 91

    The Parameter property only appears to apply to a specific Control on a
    specific Commandbar. Therefore, your code would read something like:
    WkbName = Application.CommandBars("name".ActionControl("name').Parameter
    subtituing the real names where "name" is indicated

    "Lenny" wrote:

    > When executing the following code.
    >
    > Dim WkbName As String
    >
    > WkbName = Application.CommandBars.ActionControl.Parameter
    > If WkbName = "" Or WkbName = "ThisWorkbook" Then WkbName = ThisWorkbook.Name
    >
    > I get the following error message
    >
    > Run-time error '91':
    > Object variable or With block variable not set
    >
    > COuld someone please help me correct the problem or help me with the syntax
    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 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