Link to home
Start Free TrialLog in
Avatar of PJ0302917
PJ0302917

asked on

VBA Use Windows File Dialog Box to Create a Workbook

Hi

I'm working on a VBA application and would like to let the user create a new Workbook and choose where to save it using the well know Windows Dialog boxes. I can find examples of msoFileDialogFilePicker so select a file or another method for selecting a folder but couldn't see anything to actually save a new Workbook. Could someone point me in the right direction if they know.

Thanks
Avatar of Rgonzo1971
Rgonzo1971

Hi,

pls try
 Filename = Application.GetSaveAsFilename( _ 
    fileFilter:="Excel Files (*.xls), *.xl") 
    If Filename <> False Then 
        ActiveWorkbook.SaveAs Filename 
    End If 

Open in new window

Regards
Avatar of PJ0302917

ASKER

Hi

Thanks for the help, this works. At the moment its saving the current Workbook and I need to create a new empty workbook but I'll see if I can get it working. Thanks for the help
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That worked a treat, thank you Rgonzo