PC Review


Reply
Thread Tools Rate Thread

calling up Save / Save As from a userform

 
 
Roger on Excel
Guest
Posts: n/a
 
      17th Dec 2009
Is there code to allow one to call up the Save/SaveAs dialog boxes using
command buttons on a userform?

Thanks in advance,

Roger
 
Reply With Quote
 
 
 
 
marcus
Guest
Posts: n/a
 
      17th Dec 2009
Hi Roger

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

Take care

Marcus

Application.Dialogs(xlDialogSaveAs).Show

 
Reply With Quote
 
Matthew Herbert
Guest
Posts: n/a
 
      17th Dec 2009
Roger,

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.

Best,

Matthew Herbert

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

"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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
save userform changes Miree Microsoft Excel Programming 1 22nd Apr 2009 01:38 PM
Re: save userform changes Dave Peterson Microsoft Excel Programming 0 22nd Apr 2009 01:05 PM
Clicking save results in both 'save as' word and save as draft =?Utf-8?B?aGI=?= Microsoft Outlook Discussion 0 15th Nov 2006 01:14 AM
Word 2002 save as menu says save as web page instead of just save as? Gary Microsoft Word Document Management 1 28th Jul 2006 03:26 PM
Calling Save AMDRIT Microsoft Excel Programming 1 10th Apr 2006 10:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:41 PM.