Excel XP error message Run Time Error 91

L

Lenny

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
 
G

Guest

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
 

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