Re: Using the built-in dialog to format a shape

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Greg Wilson (anonymous_at_discussions.microsoft.com)
Date: 06/15/04


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
>.
>



Relevant Pages

  • Re: Failing DC
    ... At least the ADRM password is needed, so i think not possible because you can not change it remote during the loop. ... Best regards ... Meinolf Weber ... not the broken harddisk you can also seize the FSMO roles on ...
    (microsoft.public.windows.server.active_directory)
  • Re: Loosing the Ooze
    ... planning on giving their regards to the problems. ... I read an article on the leaky valve on the Endeavour shuttle, ... spelling error I will make every attempt to correct it today. ...
    (rec.games.pinball)
  • Re: Can I unprotect / protect a shared workbook?
    ... my knowledge of Shared workbooks is severely limited as I never use ... Regards, ... > Thanks agian Norman, ... > entering into the loop and "ActiveWorkbook.ProtectSharing" before leaving ...
    (microsoft.public.excel.programming)
  • Re: Faster way to find first two minimum value of each row for a huge matrix
    ... Do this in a loop over all the elements in the matrix: ... compare it to the second smallest stored element. ...
    (comp.soft-sys.matlab)
  • Re: ADO Command object in a Loop
    ... >>I have a problem with a stored procedure call that occurs in a loop. ... >> appropriate values after the first iteration of the loop. ... >> Regards, ...
    (microsoft.public.access.modulesdaovba)