Re: Using the built-in dialog to format a shape
From: Greg Wilson (anonymous_at_discussions.microsoft.com)
Date: 06/15/04
- Next message: Steved: "Macro"
- Previous message: papou: "Re: AutoFilter on a Protected sheet"
- In reply to: Tim Saunders: "Re: Using the built-in dialog to format a shape"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Jun 2004 00:16:50 -0700
Tim,
I prefer the command bar "Line Color" for doing what
you're trying to do. I suggest this instead:
Application.CommandBars("Line Color").Visible = True
I am assuming at this point that xl2003 has changed the
dialog referencing which is causing your problem. The
statement xlDialogPatterns is just a system constant for
an integer value; i.e., MsgBox xlDialogPatters returns 84.
You can scroll the entire collection using a loop while
incrementing an integer variable. Note that the collection
is extremely long - roughly four hundred if I remember
correctly. You'll need to abort using Ctrl + Break (or
Pause). Alternatively, break up the loop into shorter runs
(1 to 50 then 51 to 100 etc.). Suggested code:
Sub ShowDialogs()
Dim i As Integer
On Error Resume Next
For i = 1 To Application.Dialogs.Count
Application.Dialogs(i).Show
MsgBox i
Next
End Sub
Regards,
Greg
>-----Original Message-----
>Thanks but that's not it - my code actually takes the
line name from a varable but I replaced it with "Line1" to
try and simplify things here. The line gets selected
successfully, that's not the problem, but the next line of
code generates a run-time error 1004 "Show method of
Dialog class failed". Any more ideas anybody?
>
>"Greg Wilson" wrote:
>
>> I'm not running XP but I suspect your problem is a
simple
>> spelling error of the line name. Note that when you add
a
>> line to a worksheet, the default names are "Line"
followed
>> by a space and then a number (eg. "Line 1"). Your
spelling
>> excludes a space. Your code works for me if I spell the
>> line name correctly.
>>
>> Regards,
>> Greg
>>
>> >-----Original Message-----
>> >I am sure I am missing something obvious...
>> >Just upgraded to Office XP. Previously did this with
no
>> problems:
>> > Sheets("Drawing").Drawings("Line1").Select
>> > Application.Dialogs(xlDialogPatterns).Show
>> >but now it seems I have to use shapes instead of
drawings
>> and the following code does not work and I cannot find
a
>> fix:
>> > Sheets("Drawing").Shapes("Line1").Select
>> > Application.Dialogs(xlDialogPatterns).Show
>.
>
- Next message: Steved: "Macro"
- Previous message: papou: "Re: AutoFilter on a Protected sheet"
- In reply to: Tim Saunders: "Re: Using the built-in dialog to format a shape"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|