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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Save As" and Custom made menu

Status
Not open for further replies.

sofiavba

Programmer
Apr 4, 2006
19
US
Hi everyone,

Could anyone tell me how to create a Save As dialog box to pop up when a user clicks on a custom made menu option in excel. I have menu option called Check In, when a user clicks it a popup should display like a save as option. The user then can choose to save the excel file in any format he/she likes.
 
Have a look at the Application.GetSaveAsFilename method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I use something like this

====Start Code=======
Private Const BIF_RETURNONLYFSDIRS As Long = &H1
Private Const BIF_DONTGOBELOWDOMAIN As Long = &H2
Private Const BIF_RETURNFSANCESTORS As Long = &H8
Private Const BIF_BROWSEFORCOMPUTER As Long = &H1000
Private Const BIF_BROWSEFORPRINTER As Long = &H2000
Private Const BIF_BROWSEINCLUDEFILES As Long = &H4000
Private Const MAX_PATH As Long = 260


Function BrowseFolder(Optional Caption As String, _
Optional InitialFolder As String) As String

Dim SH As Shell32.Shell
Dim F As Shell32.Folder

Set SH = New Shell32.Shell
Set F = SH.BrowseForFolder(0&, Caption, BIF_RETURNONLYFSDIRS, _
InitialFolder)

If Not F Is Nothing Then
BrowseFolder = F.Items.item.Path
End If

End Function
=====Interrupt for comments======
This first section above just gets put into the first section of your code (I guess that's kind of a 'duh' but just in case you didn't know)
=====restart code===========
Dim FName As String
DestFolder = BrowseFolder("Select a folder", "c:\My Computer")
If DestFolder = "" Then
MsgBox "You didn't select a folder"
Else
'proceed with program
End If
======End code======
This section you would put into your program where you want to call the "save as" GUI.
Hope this was helpfull!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top