BuiltIn Dialog Boxes

HighAndWilder

Board Regular
Joined
Nov 4, 2006
Messages
80
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
 

igold

Well-known Member
Joined
Jul 8, 2014
Messages
2,429
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:

HighAndWilder

Board Regular
Joined
Nov 4, 2006
Messages
80
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)
 

igold

Well-known Member
Joined
Jul 8, 2014
Messages
2,429
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"
 

HighAndWilder

Board Regular
Joined
Nov 4, 2006
Messages
80
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/microsoft-office/excel/how-to-use-vba-to-display-excel-2016s-built-in-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
 

Forum statistics

Threads
1,078,365
Messages
5,339,767
Members
399,323
Latest member
letitiaysk

Some videos you may like

This Week's Hot Topics

Top