Results 1 to 8 of 8

Thread: BuiltIn Dialog Boxes
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Nov 2006
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default BuiltIn Dialog Boxes

    Hi

    I'd like to load Excel BuiltIn Dialog Boxes by using the following line of code or similar and where the strDialogBox variable contains the
    name of the Dialog Box to load.

    strDialogBox="xlDialogFontProperties"

    Application.Dialogs(strDialogBox).Show

    How would I do this?

    I'd like to open the Format Cells Dialog Box but I'm not sure which one it is. I'd like to be able to select a certain Tab on the Dialog Box, e.g. Fill or Font.

    Any ideas anybody?

    Thanks

  2. #2
    Board Regular igold's Avatar
    Join Date
    Jul 2014
    Location
    Delray Beach, FL, USA
    Posts
    2,349
    Post Thanks / Like
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)

    Default Re: BuiltIn Dialog Boxes

    Errant post
    Last edited by igold; Aug 20th, 2019 at 07:14 PM.
    ​igold

    I'm a drinker with a coding problem...

    All code is written with Excel 2010 - Please test all code on a backup copy of your data.


  3. #3
    Board Regular igold's Avatar
    Join Date
    Jul 2014
    Location
    Delray Beach, FL, USA
    Posts
    2,349
    Post Thanks / Like
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)

    Default Re: BuiltIn Dialog Boxes

    Perhaps I am not understanding, but is this what you are looking for. It seems like you have it already...

    Both of these will open the Format Cells Font Dialog box.

    Code:
    Dim strDialogBox
    strDialogBox = xlDialogFontProperties
    Application.Dialogs(strDialogBox).Show
    or

    Code:
    Application.CommandBars.ExecuteMso ("FormatCellsFontDialog")
    Last edited by igold; Aug 20th, 2019 at 07:46 PM.
    ​igold

    I'm a drinker with a coding problem...

    All code is written with Excel 2010 - Please test all code on a backup copy of your data.


  4. #4
    Board Regular
    Join Date
    Nov 2006
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: BuiltIn Dialog Boxes

    I am getting a 'Type Mismatch' error with this

    Application.Dialogs(strDialogBox).Show

    and an 'Invalid Procedure Call Or Argument' error with this

    Application.CommandBars.ExecuteMso (strDialogBox)

  5. #5
    MrExcel MVP FormR's Avatar
    Join Date
    Aug 2011
    Location
    UK
    Posts
    6,089
    Post Thanks / Like
    Mentioned
    24 Post(s)
    Tagged
    2 Thread(s)

    Default Re: BuiltIn Dialog Boxes

    Quote Originally Posted by HighAndWilder View Post
    I am getting a 'Type Mismatch' error with this
    Hi, have you removed the quotes highlighted red below to match the code in post 3

    Quote Originally Posted by HighAndWilder View Post
    strDialogBox="xlDialogFontProperties"
    Last edited by FormR; Aug 21st, 2019 at 04:31 AM.
    [code]your code[/code]

  6. #6
    Board Regular igold's Avatar
    Join Date
    Jul 2014
    Location
    Delray Beach, FL, USA
    Posts
    2,349
    Post Thanks / Like
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)

    Default Re: BuiltIn Dialog Boxes

    Quote Originally Posted by HighAndWilder View Post

    and an 'Invalid Procedure Call Or Argument' error with this

    Application.CommandBars.ExecuteMso (strDialogBox)
    Also, if you look closely this command did not use your variable "strDialogBox" but rather "FormatCellsFontDialog"
    ​igold

    I'm a drinker with a coding problem...

    All code is written with Excel 2010 - Please test all code on a backup copy of your data.


  7. #7
    Board Regular
    Join Date
    Nov 2006
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: BuiltIn Dialog Boxes

    It is this that works :

    Application.CommandBars.ExecuteMso "FormatCellsFontDialog"


    I also found this page that just so happens to be on dummies.com!!!

    https://www.dummies.com/software/mic...-dialog-boxes/

    I quote from the web page :

    Virtually every command available in Excel is listed in the left panel. Find the command you need and hover your mouse over it, and you
    see its secret command name in the tooltip (it’s the part in parentheses).


    Whilst I can find out the 'secret command name' by hovering over the command I would much rather find a narrated list by Microsoft.

    Does anybody know if one exists?

    Thanks

  8. #8
    Board Regular igold's Avatar
    Join Date
    Jul 2014
    Location
    Delray Beach, FL, USA
    Posts
    2,349
    Post Thanks / Like
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)

    Default Re: BuiltIn Dialog Boxes

    Last edited by igold; Aug 21st, 2019 at 12:10 PM.
    ​igold

    I'm a drinker with a coding problem...

    All code is written with Excel 2010 - Please test all code on a backup copy of your data.


Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •