Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default 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,

Roger
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default calling up Save / Save As from a userform

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default calling up Save / Save As from a userform

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable save, save as, but allow save via command button TimN Excel Programming 10 September 1st 06 07:05 PM
Calling Excel File Save As Dialog Bookreader Excel Programming 3 July 14th 06 05:40 PM
How to diasble save and save as menu but allow a save button hon123456 Excel Programming 1 June 12th 06 09:50 AM
Calling Save AMDRIT Excel Programming 1 April 10th 06 10:21 PM
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM


All times are GMT +1. The time now is 05:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"