Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set up Dialog Box 1

Status
Not open for further replies.

Quintios

Technical User
Mar 7, 2002
482
US
I have a macro which causes a sheet from the current workbook to be copied to a new workbook and then have that new workbook saved as a .CSV file to the user's desktop. I would like to preselect some items as follows:

The file type is ".CSV"
The file name is "Database"
The locaion is a bit trickier. I'd like to save to the desktop of the current user. We have roaming profiles here so I can't hard code in the path to save to.

The current code for the dialog box is:

Code:
Application.Dialogs(xlDialogSaveAs).Show

How should I change this to get the selections I require?

Thanks in advance!
Onwards,

Q-
 
I actually figured it out myself! Except for the path part. It defaults to the default 'save as' path that the user entered into Excel. Any way to set that up?

Here's the code that does 2/3's of what I want:
Code:
    Application.Dialogs.Item(xlDialogSaveAs).Show _
        arg1:="acm_db", arg2:=xlCSV

Where would I put a default path in there? I do notice that the path is saved as long as the workbook is kept open, but it would still be nice to change it somehow.
Onwards,

Q-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top