Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default SaveAs Dialog Box

Hi
A message box pop-ups before the workbook closes to see if the user wishes
to save the workbook.

If the user chooses Yes then I would like the SaveAs dialog box to pop-up so
they can choose the location they wish to save the workbook and with whatever
name they wish.

Just for background purposes, before the user has this option the workbook
is saved to their C drive so we can give it a common name for email purposes.
Once the form has been emailed that is when I would like to give the user an
option of savign the workbook to a drive, folder and name of their chose.

Thanks
Noemi
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default SaveAs Dialog Box

Maybe this will work for you

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sFilename
If MsgBox("Save the file?", vbYesNo) = vbYes Then
sFilename = Application.GetSaveAsFilename( _
fileFilter:="Microsoft Excel File (*.xls), *.xls")
If sFilename < False Then
ThisWorkbook.SaveAs sFilename
End If
End If
End Sub

Private Sub Workbook_Open()
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Noemi" wrote in message
...
Hi
A message box pop-ups before the workbook closes to see if the user wishes
to save the workbook.

If the user chooses Yes then I would like the SaveAs dialog box to pop-up

so
they can choose the location they wish to save the workbook and with

whatever
name they wish.

Just for background purposes, before the user has this option the workbook
is saved to their C drive so we can give it a common name for email

purposes.
Once the form has been emailed that is when I would like to give the user

an
option of savign the workbook to a drive, folder and name of their chose.

Thanks
Noemi



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
SaveAs dialog Gary''s Student Excel Discussion (Misc queries) 2 February 23rd 06 03:11 PM
prevent saveAs dialog keithb Excel Programming 1 September 9th 05 06:37 PM
SaveAs Dialog box Daniel Bonallack Excel Programming 2 April 1st 05 09:25 AM
Disable Saveas Dialog Tom Ogilvy Excel Programming 0 September 15th 04 05:41 PM
Saveas Dialog Box Tom Ogilvy Excel Programming 0 September 15th 04 04:57 PM


All times are GMT +1. The time now is 08:50 AM.

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"