LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Using the built-in dialog to format a shape

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

.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function Arguments dialog vanishes when clicked an inserted shape RK Excel Worksheet Functions 2 February 2nd 09 07:58 AM
Built-in Dialog Box Argument Button Paula Excel Discussion (Misc queries) 0 March 30th 07 08:40 PM
Re : Making use of the Built-in Dialog Boxes TKT-Tang Excel Programming 3 December 9th 03 08:33 AM
Getting a file name using a built in dialog box Steven Revell Excel Programming 1 November 18th 03 01:14 PM
Built-in file dialog question MacroMan Excel Programming 1 August 7th 03 11:53 PM


All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"