Excel and Windows Dialogs

Posted on Saturday 8 April 2006

Excel allows us to get hold of many builtin dialogs via it's object model. For example:

Sub OpenDialog()

Application.Dialogs(xlDialogOpen).Show

End Sub

Shows the open file dialog. More infomation can be found here:

http://support.microsoft.com/?kbid=213371#E6ACAAA

A lot of the time, what Excel is doing is using API layers to get hold of these diologs (i.e. the common dialogs), it then allows us to use them with a few lines of code. But If you can't get the fuctionality you want from the Excel object, you should be able to find an API method. Here's a SaveAs one for example:

http://www.mvps.org/access/api/api0001.htm

Note: you will need to change the line "If IsMissing(hwnd) Then hwnd = Application.hWndAccessApp" to "If IsMissing(hwnd) Then hwnd = Application.hWnd" to get it to work, and some of the filters to get it to function as you like in Excel.

     

No comments have been added to this post yet.

Leave a comment

(required)

(required)


.

Use [VBA] Your Code [/VBA], when posting code, cheers Ross x /


RSS feed for comments on this post | TrackBack URI