calling up Save / Save As from a userform

Is there code to allow one to call up the Save/SaveAs dialog boxes using 
command buttons on a userform?

Thanks in advance,

12/17/2009 5:23:01 AM
excel.programming 6508 articles. 2 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 22

Hi Roger

Use this for bringing up the Saveas dialog box.  Attach it to your
code for a commmand button.

Take care



12/17/2009 5:50:55 AM

The GetSaveAsFilename method should do the trick.  You can embed the code in 
the command button click event.  The help documentation on GetSaveAsFilename 
is good, so search the help from VBE for GetSaveAsFilename.

A side note to GetSaveAsFilename is that the method doesn't actually save 
anything, so you'll have to do some input validation in addition to an actual 
save operation (i.e. the Save method).  For example, GetSaveAsFilename 
returns a Variant.   The two Variant return types (that I'm aware of) are 
Boolean and String.  The method returns "False" if the dialog box is 
canceled, or it returns the fully qualified file name (i.e. the directory 
hierarchy, file name, and file extension) of a valid input.  You can test the 
type of data returned using the TypeName function.  Also, the method doesn't 
perform an actual save operation, so you'll have to us the Save method if you 
plan on needing to save the file.


Matthew Herbert

Dim varRes as Variant
varRes = Application.GetSaveAsFilename(....'etc.
If TypeName(varRes) = "Boolean" Then

"Roger on Excel" wrote:

> Is there code to allow one to call up the Save/SaveAs dialog boxes using 
> command buttons on a userform?
> Thanks in advance,
> Roger
12/17/2009 5:55:01 AM

Similar Artilces:

Covered Call Options
Hello all, I do I go about dealing with a covered call transaction in Microsoft Money 2007 Premium? Currently what I am doing is inputing the option symbol, and choosing the transaction "Sell to Open" then when I go to expire the option I try to do a Sell to Close. However it does not seem to work? Also what happens if instead of expired I has the position assigned? how would I account for that? Thank you. Shhhh In, Shhhh wrote: > >I do I go about dealing with a covered call transaction in Microsoft >Money 2007 Premium? Currently what I am doing is...

Saving Files
I am trying to write something that will open a series of files in a folder, identify a certain cell reference, and then resave the file in a different location with the cell reference as a file name. Ex: It opens fileA from the source folder, sees that the reference cell is 001, then saves it in the destination folder as 001.xls. It then opens fileB, sees the reference of AA3, and saves it as AA3.xls. Here is what I have written so far. I have 0 experience with VBA but I am trying to learn by looking at examples online. Something is wrong here: Sub SaveFiles() Dim mybook As Workbo...

Can I undo a sort after saving.
I have a workbook that I have placed columns across that is Date, State, Client, Class, County, Contact Person, Phone, EXT, Status, Map Code, Fax and Reference/comments. I corrupted this thing and have several (save as) with different file names as for recovery but I am afraid that I must of ruined on of the first ones. I will have to do more investigation in the morning. I think that I have done a sort function accidently, that sorted only one or to columns so now the name doesn’t match Client or Phone. I am not sure yet but Name may match phone number but I know some of them do not match...

Freeze Panes not saving
I am using freeze panes on several sheets. After a save, close and open the panes are no longer frozen. Why isn't this attribute sticking (like it used to)? Is it just me? W'2000 Excel'2002 SP2 It's not just you Dean! I've been going nuts because it's happening to me too & I can't figure out why. But mine is even stranger...I can freeze, save, close then re-open and the panes are still frozen. However, if I open the file later in the day or the next day, not frozen. Anybody have any insight? Running Excel 2000 SP1 >-----Original Message----- >...

Save as HTML in excel2002
Hi, I have recently changed my W2K with Excel97 to XP with=20 excel2002. Now I have the following problem: The function Save As HTML is changed. It used to deliver a=20 flat structure of "gif=B4s" for each chart in the workbook.=20 And that is what I desperately need for my web site. Does anyone know if I can still get this output from=20 Excel2002? Please copy replies to my e-mail. Regards, Mats I don't speak HTML, but I just tried saving a file with a chart on a worksheet using xl2002--as an .html file (as a web page). I got these 3 files in the same folder: book4.htm bo...

Call in?
Do new owners of Office X have to call up Microsoft to register their copy? If yes, what's the number? thanks. Ming <> wrote: > Do new owners of Office X have to call up Microsoft to register their > copy? If yes, what's the number? thanks. Nope. We're not using Windoze :->>> This version does not require activation. Corentin -- - Mac:MS MVP (Francophone) - (MS) MVP:;FR;mvp Newsgroups produits MS: ...

can i restore a file when asked to save i hit no, can you help?
I was working in word 2007 and when I closed out, it asked me to save can I retrieve that file? I had saved it several times while working on it. Assuming it wasn't a file you'd opened from an email attachment, then the last saved version should be exactly where you left it. But you can't retrieve the changes you made after the last time you saved it. (If it had been opened from an email attachment, then you were "saving" it to a temp folder, and it went away when you closed Word.) On Nov 28, 4:35=A0pm, Linda <> wrote: &g...

Prompt to save when using a tab control
Hi there In my database, I have a form which consists of 5 tabs. When a user moves from tab to tab, is it possible to set a prompt that prompts the user to save their work? I have users who think that this is a necessary feature of my database. Thank you in advance for your help. On Sun, 21 Mar 2010 17:29:01 -0700, forest8 <> wrote: >Hi there > >In my database, I have a form which consists of 5 tabs. > >When a user moves from tab to tab, is it possible to set a prompt that >prompts the user to save their wor...

Call center tracking and reporting
Anyone use CRM 4.0 for call tracking? Our Sales/Marketing is set up. Now I need to decide how to most efficiently customize CRM 4.0 for our company's call tracking portion. Can someone send me a link to information? thanks ...

Save Macro with date in name
Hi, I have a macro that I want to complete by saveing the file with the current date ate the end of the file name. I have this code but I get an error with the "DateAdd". ActiveWorkbook.SaveAs Filename:="Monthly Accrual Upload" & DateAdd ("MMMM") & " - " & DateAdd ("yyyymmdd") & ".xls", _ FileFormat:=xlText, CreateBackup:=False How can I get the file name for April to be; Monthly Accrual Upload - APRIL - 20101604 Thanks Rick Use Format() as below Msgbox "Monthly Accrual Upl...

telephone calls
when placing a telephone call using outlook, everything works fine except I can't hear the person i am talking to. They can hear me find. When I use a telephone program not associated with outlook every thing works great. can someone help ...

Calling Macro
Hi All, I have macro like this sub unique() '''''''' '''''''' Counter_item = 0 For Each Item In nodups counter_item = counter_item + 1 bic_var = Item Call Ps_Match Next Item end sub I have another macro Sub Ps_Match() ''''' ''''' If counter_item <= 1 Then call another_macro() end if end sub In the first macro i am declaring counter_item equals to 1. In my second macro i need to call that number. At the to of the module put: Public Counter_I...

Balancing Savings Account
I have Money 2004 and have been using money for years. Over the past several versions, I have noticed that when I go to balance a Savings account that earns interest, the system freezes on me if I enter the Interest amount in the Balance Wizard at the begining. I have to leave it blank then postpone the balance and when I start to balance again, it lets me put an interest amount in the wizard. What can I do to resolve this? This was happening on 2003, and 2002. Thanks for your help in advance. This question has come up before, and I don't recall seeing a 'true fix' listed ...

Workflow -Assembly Call
How does add subtract in the Workflow>> assembly call works. I do understand that ypu can write your own custom workflows, register it and then call them from here, but I am pretty confused with the existing functionality. workflows can call other workflows workflows can also call a method in a .net assembly. ie you could write a piece of code in c# or and then have the workflow call your code. ======================= John O'Donnell Microsoft CRM MVP "SAM" <> wrote in message news:DE...

Async calls to WebService in MFC
Hey guys, I use a webservice over the net which is scripted in VB.Net. This web service receives a username and a password and returns a string structure with multiples infos. If the string is empty, I had the wrong username and/or password. Pretty simple isn't? Ok now the problem is a bit more complex. I'm using an MFC client to connect to these web services, and since they're on the internet, there's a delay between sending the data and receiving an answer. I don't know really how I can tell me client to "wait for the string". The wrapper MFC created for the w...

Invalid procedure call or argument?
Hello All This is a re-post of a problem I posted a while ago, but to which I got no suggestions: hopefully I'll be more lucky this time!? I have the following code in a Private Sub: If InStr([ResponseXML], "element") > 0 Then errorfield = "Invalid " & Mid([ResponseXML], InStr([ResponseXML], "element"), InStr(InStr(InStr([ResponseXML], "element"), [ResponseXML], "'") + 1, [ResponseXML], "'") - InStr([ResponseXML], "element") + 1) Else .... Most of the time this works fine, but for some...

Macro needed, Two saves in One
Hi, I need some help. I have a Visio page open and I have saved it once already as a VSD file. So it already has a filename with a aVSD extension. So I'd like to be able to click a macro button that does this Application.ActiveDocument.Save then this Application.ActiveWindow.Page.Export "C:\Documents and Settings\Visio Stuff\PNG\SameFileNameAsVisioFileName.png" i.e. Export the file (keeping the same filename as the VSD name) but as a PNG in my PNG subfolder . Any help appreciated. (Should I move this to a VBA newsgroup ?) Jojo On Mon, 26 Mar 2007 13:46:58 +...

Legend Changes After Save
I am working in Excel 2007. When I delete certain Series from the legend, save and close the file, the next time I open it the deleted series are back. How can I stop it from defaulting back? Thanks! PD, I can't duplicate this problem, why don't you send me a copy of the file before you delete the item from the legend and tell me exactly what you do, so I can duplicate it. -- Cheers, Shane Devenshire Microsoft Excel MVP "WolfgangPD" wrote: > I am working in Excel 2007. When I delete certain Series from the legend, > save and...

Hi, Please can you advise how it i possible to do the following. I would like for a user to click a button on worksheet "Mail", and fo worksheet "EAR" to save as value of Startdata!A1" and todays date. would then like sheet EAR to print and the file to stay open. Also, th contents of EAR are derived from being equal to other sheets, is i possible to hold the data so EAR's content remains intact? Thanks PS. Got this so far: Sub Save() Dim strdate As String Dim uname With ActiveWorkbook.Worksheets("Sheet1") uname = .Range("A1").Value & ...

Duplicate databases being saved
Good afternoon, We have a database that about 8 users access on a regular basis. Somehow, we are getting the BE database to replicate - about 30 times since May 07 - named as: db1, db2, db3... db30 We do have users access via VPN. Each user has FE loaded on individual computers linked to BE db on server. The FE compacts on closing, Record Locks are off, Using Access 2000. Any help would be appreciated. -- Thanks, Tina Hudson Turn off Compact on Close on both the FE and BE databases. That's probably what's causing the duplicate database files. As an Access database file ...

Unable to get DxgkDdiRecommendFunctionalVidPn call in windows 7
I am trying to add an initial vidpn topology by implementing the DxgkDdiRecommendFunctionalVidPn call in the WDDM miniport driver. But starting from windows 7 i am unable to get the DxgkDdiRecommendFunctionalVidPn function call from dxgkrnl.After searching through the MSDN documentation i found out that the function is deprecated starting from windows 7. msdn link: According to msdn "On a computer running Windows 7, the display mode manager (DMM) determines an appropriate VidPN topology to apply using VidPN history d...

Changes not getting saved to data source
Hi. I'm kinda new with ADO .NET. I'm having trouble saving edit and delete changes back to the data source. Adding new record is fine. Only edits and deletes don't work. Here's my code: Dim r As DataSet1.PeopleRow OleDbDataAdapter1.Fill(DataSet11) r = DataSet11.People.Rows(0) r.Name = "Kevin" r.AcceptChanges() Dim ret As Integer = OleDbDataAdapter1.Update(DataSet11) My DataAdapter and Dataset are strongly typed and they were created through VS 2008 data wizard. By the way, I'm using an MS A...

Where to call SetWindowPos
In my SDI, can I place the following in CMainFrame::OnCreate( )? Or is there a better place? // ensure window opens on top when called by other applications, esp. the installer SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); Note that wndTopMost really means it is always on top and can never have another app come on top of it. So wndTopMost is often a poor choice. SetWindowPos would not be the best choice here; SetForegroundWindow would be better. joe On Sat, 11 Aug 2007 17:04:00 -0400, "SteveR" <> wrote: >...

Call out to detect attaching files
Hi All, Is there a method to write a callout to detect file uploads. i knoe that when i file is uploading it's going to annotation entity. i have written preupdate and postupdate methods to track this. but when i add a file the event doesn't get fired and doesn't indicate the changes. later if i do a change to the note then i'm able to see the changes. can anyone tell me the reason... Thanks, Charith On Aug 7, 2:34 am, Charith <> wrote: > Hi All, > > Is there a method to write a callout to detect file uploads. i knoe tha...

Temp file grows(no-end)when Excel97 attempts to save to net-2003Se
With some Excel 97 spreadsheets, saving to the H: drive will cause the cursor to change to an hourglass until you do Ctrl-Alt-Del to end-task Excel. The same file can be saved to the hard drive of your PC or to a floppy disk without a problem. Further research revealed that what was happening was that a temporary file was growing without stopping when Excel attempted to save to a network drive (the H: drive) on a Windows 2003 server. We have found out there are many people who have experienced this problem but have yet to find anyone w/a solution, Can you help? (any suggestions?...